Skip to content

Commit

Permalink
Kernel: Run clang-format on everything.
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jun 7, 2019
1 parent 98eeb8f commit bc951ca
Show file tree
Hide file tree
Showing 63 changed files with 969 additions and 851 deletions.
49 changes: 24 additions & 25 deletions Kernel/Devices/BXVGADevice.cpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#include <Kernel/Devices/BXVGADevice.h>
#include <Kernel/IO.h>
#include <Kernel/PCI.h>
#include <Kernel/VM/MemoryManager.h>
#include <Kernel/Process.h>
#include <Kernel/VM/MemoryManager.h>
#include <LibC/errno_numbers.h>

#define VBE_DISPI_IOPORT_INDEX 0x01CE
#define VBE_DISPI_IOPORT_DATA 0x01CF

#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1
#define VBE_DISPI_INDEX_YRES 0x2
#define VBE_DISPI_INDEX_BPP 0x3
#define VBE_DISPI_INDEX_ENABLE 0x4
#define VBE_DISPI_INDEX_BANK 0x5
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
#define VBE_DISPI_INDEX_X_OFFSET 0x8
#define VBE_DISPI_INDEX_Y_OFFSET 0x9
#define VBE_DISPI_DISABLED 0x00
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_LFB_ENABLED 0x40

#define BXVGA_DEV_IOCTL_SET_Y_OFFSET 1982
#define BXVGA_DEV_IOCTL_SET_RESOLUTION 1985
#define VBE_DISPI_IOPORT_INDEX 0x01CE
#define VBE_DISPI_IOPORT_DATA 0x01CF

#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1
#define VBE_DISPI_INDEX_YRES 0x2
#define VBE_DISPI_INDEX_BPP 0x3
#define VBE_DISPI_INDEX_ENABLE 0x4
#define VBE_DISPI_INDEX_BANK 0x5
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
#define VBE_DISPI_INDEX_X_OFFSET 0x8
#define VBE_DISPI_INDEX_Y_OFFSET 0x9
#define VBE_DISPI_DISABLED 0x00
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_LFB_ENABLED 0x40

#define BXVGA_DEV_IOCTL_SET_Y_OFFSET 1982
#define BXVGA_DEV_IOCTL_SET_RESOLUTION 1985
struct BXVGAResolution {
int width;
int height;
Expand Down Expand Up @@ -75,7 +75,7 @@ dword BXVGADevice::find_framebuffer_address()
static const PCI::ID bochs_vga_id = { 0x1234, 0x1111 };
static const PCI::ID virtualbox_vga_id = { 0x80ee, 0xbeef };
dword framebuffer_address = 0;
PCI::enumerate_all([&framebuffer_address] (const PCI::Address& address, PCI::ID id) {
PCI::enumerate_all([&framebuffer_address](const PCI::Address& address, PCI::ID id) {
if (id == bochs_vga_id || id == virtualbox_vga_id) {
framebuffer_address = PCI::get_BAR0(address) & 0xfffffff0;
kprintf("BXVGA: framebuffer @ P%x\n", framebuffer_address);
Expand All @@ -95,11 +95,10 @@ KResultOr<Region*> BXVGADevice::mmap(Process& process, FileDescription&, LinearA
move(vmo),
0,
"BXVGA Framebuffer",
prot
);
prot);
kprintf("BXVGA: %s(%u) created Region{%p} with size %u for framebuffer P%x with laddr L%x\n",
process.name().characters(), process.pid(),
region, region->size(), framebuffer_address().as_ptr(), region->laddr().get());
process.name().characters(), process.pid(),
region, region->size(), framebuffer_address().as_ptr(), region->laddr().get());
ASSERT(region);
return region;
}
Expand Down
1 change: 0 additions & 1 deletion Kernel/Devices/DebugLogDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ ssize_t DebugLogDevice::write(FileDescription&, const byte* data, ssize_t data_s
IO::out8(0xe9, data[i]);
return data_size;
}

4 changes: 2 additions & 2 deletions Kernel/Devices/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <LibC/errno_numbers.h>

Device::Device(unsigned major, unsigned minor)
: m_major(major)
, m_minor(minor)
: m_major(major)
, m_minor(minor)
{
VFS::the().register_device({}, *this);
}
Expand Down
1 change: 0 additions & 1 deletion Kernel/Devices/DiskDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ bool DiskDevice::write(DiskOffset offset, unsigned length, const byte* in)
ASSERT(end_block <= 0xffffffff);
return write_blocks(first_block, end_block - first_block, in);
}

3 changes: 2 additions & 1 deletion Kernel/Devices/DiskPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Retained<DiskPartition> DiskPartition::create(Retained<DiskDevice>&& device, uns
}

DiskPartition::DiskPartition(Retained<DiskDevice>&& device, unsigned block_offset)
: m_device(move(device)), m_block_offset(block_offset)
: m_device(move(device))
, m_block_offset(block_offset)
{
}

Expand Down
1 change: 0 additions & 1 deletion Kernel/Devices/FileBackedDiskDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,3 @@ const char* FileBackedDiskDevice::class_name() const
{
return "FileBackedDiskDevice";
}

3 changes: 1 addition & 2 deletions Kernel/Devices/FullDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "FullDevice.h"
#include <LibC/errno_numbers.h>
#include <AK/StdLibExtras.h>
#include <AK/kstdio.h>
#include <LibC/errno_numbers.h>

FullDevice::FullDevice()
: CharacterDevice(1, 7)
Expand Down Expand Up @@ -30,4 +30,3 @@ ssize_t FullDevice::write(FileDescription&, const byte*, ssize_t size)
return 0;
return -ENOSPC;
}

Loading

0 comments on commit bc951ca

Please sign in to comment.