Skip to content

Commit

Permalink
Large module cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jezze committed Jun 12, 2011
1 parent 2e5b4ba commit c129e0e
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 135 deletions.
2 changes: 1 addition & 1 deletion arch/x86/modules/io/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <kernel/vfs.h>
#include <arch/x86/modules/io/io.h>

struct modules_io_device ioDevice;
struct io_device ioDevice;

static unsigned int io_device_read(char *buffer, unsigned int count, unsigned int offset)
{
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/modules/kbd/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ char kbdMapUpperUS[128] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

struct modules_kbd_device kbdDevice;
struct kbd_device kbdDevice;

static unsigned int kbd_device_read(char *buffer)
{
Expand Down Expand Up @@ -135,7 +135,7 @@ void kbd_init()
struct file_node *devNode = call_open("/dev");
file_write(devNode, devNode->length, 1, &kbdDevice.node);

modules_register(MODULES_TYPE_KEYBOARD, &kbdDevice.base);
modules_register(MODULES_TYPE_KEYBOARD, &kbdDevice.base.base);

irq_register_handler(IRQ_ROUTINE_KBD, kbd_handler);

Expand Down
6 changes: 3 additions & 3 deletions arch/x86/modules/serial/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <arch/x86/modules/io/io.h>
#include <arch/x86/modules/serial/serial.h>

struct modules_serial_device serialDeviceCom1;
struct serial_device serialDeviceCom1;

static int serial_in_ready(unsigned short port)
{
Expand All @@ -26,7 +26,7 @@ static char serial_inb(unsigned short port)

}

static unsigned int serial_read(struct modules_serial_device *device, char *buffer, unsigned int count)
static unsigned int serial_read(struct serial_device *device, char *buffer, unsigned int count)
{

unsigned int i;
Expand Down Expand Up @@ -54,7 +54,7 @@ static void serial_outb(unsigned short port, char c)

}

static unsigned int serial_write(struct modules_serial_device *device, char *buffer, unsigned int count)
static unsigned int serial_write(struct serial_device *device, char *buffer, unsigned int count)
{

unsigned int i;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/modules/vga/vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <arch/x86/modules/io/io.h>
#include <arch/x86/modules/vga/vga.h>

struct modules_vga_device vgaDevice;
struct vga_device vgaDevice;
unsigned char vgaFbColor;

static unsigned int vga_read_framebuffer(char *buffer, unsigned int count, unsigned int offset)
Expand Down Expand Up @@ -139,7 +139,7 @@ void vga_init()
file_write(devNode, devNode->length, 1, &vgaDevice.nodeCursorColor);
file_write(devNode, devNode->length, 1, &vgaDevice.nodeCursorOffset);

modules_register(MODULES_TYPE_VGA, &vgaDevice);
modules_register(MODULES_TYPE_VGA, &vgaDevice.base);

}

230 changes: 115 additions & 115 deletions build/Makefile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/arch/x86/modules/io/io.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ARCH_IO_H
#define ARCH_IO_H

struct modules_io_device
struct io_device
{

struct modules_module base;
Expand Down
4 changes: 2 additions & 2 deletions include/arch/x86/modules/kbd/kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

struct isr_registers;

struct modules_kbd_device
struct kbd_device
{

struct modules_io_device base;
struct io_device base;
char buffer[256];
unsigned int bufferSize;
unsigned int bufferHead;
Expand Down
6 changes: 3 additions & 3 deletions include/arch/x86/modules/serial/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#define SERIAL_COM3 0x03E8
#define SERIAL_COM4 0x02E8

struct modules_serial_device
struct serial_device
{

struct modules_module base;
unsigned int port;
unsigned int (*read)(struct modules_serial_device *device, char *buffer, unsigned int count);
unsigned int (*write)(struct modules_serial_device *device, char *buffer, unsigned int count);
unsigned int (*read)(struct serial_device *device, char *buffer, unsigned int count);
unsigned int (*write)(struct serial_device *device, char *buffer, unsigned int count);
struct file_node node;

};
Expand Down
2 changes: 1 addition & 1 deletion include/arch/x86/modules/vga/vga.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define VGA_FB_ADDRESS 0xB8000
#define VGA_FB_SIZE 2000

struct modules_vga_device
struct vga_device
{

struct modules_module base;
Expand Down
4 changes: 2 additions & 2 deletions include/modules/elf/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

struct elf_header;

struct modules_binary_module
struct elf_module
{

struct modules_module base;
unsigned int (*check)(struct modules_binary_module *module, void *address);
unsigned int (*check)(struct elf_module *module, void *address);

};

Expand Down
2 changes: 1 addition & 1 deletion include/modules/tty/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define TTY_COLOR_RED2 0x0c
#define TTY_COLOR_WHITE 0x0f

struct modules_tty_device
struct tty_device
{

struct modules_module base;
Expand Down
2 changes: 1 addition & 1 deletion modules/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <kernel/modules.h>
#include <modules/elf/elf.h>

struct modules_binary_module elfModule;
struct elf_module elfModule;

unsigned int elf_check(void *address)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/tty/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <kernel/vfs.h>
#include <modules/tty/tty.h>

struct modules_tty_device ttyDevice;
struct tty_device ttyDevice;

struct file_node *ttyVgaNode;
struct file_node *ttyVgaColorNode;
Expand Down

0 comments on commit c129e0e

Please sign in to comment.