Fixed the messed up indentation (8 spaces instead of tabs)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@309 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-07-18 15:03:13 +00:00
parent eb0471173e
commit de8acfc621
+21 -11
View File
@@ -29,17 +29,21 @@ struct io_vector {
static struct io_vector *io_vectors = NULL;
int int_init(kernel_args *ka)
int
int_init(kernel_args *ka)
{
dprintf("init_int_handlers: entry\n");
return arch_int_init(ka);
}
int int_init2(kernel_args *ka)
int
int_init2(kernel_args *ka)
{
io_vectors = (struct io_vector *)kmalloc(sizeof(struct io_vectors *) * NUM_IO_VECTORS);
if(io_vectors == NULL)
if (io_vectors == NULL)
panic("int_init2: could not create io vector table!\n");
memset(io_vectors, 0, sizeof(struct io_vector *) * NUM_IO_VECTORS);
@@ -47,7 +51,9 @@ int int_init2(kernel_args *ka)
return arch_int_init2(ka);
}
int int_set_io_interrupt_handler(int vector, int (*func)(void*), void* data)
int
int_set_io_interrupt_handler(int vector, int (*func)(void*), void* data)
{
struct io_handler *io;
int state;
@@ -56,7 +62,7 @@ int int_set_io_interrupt_handler(int vector, int (*func)(void*), void* data)
// handlers registered for this io interrupt
io = (struct io_handler *)kmalloc(sizeof(struct io_handler));
if(io == NULL)
if (io == NULL)
return ENOMEM;
io->func = func;
io->data = data;
@@ -73,7 +79,9 @@ int int_set_io_interrupt_handler(int vector, int (*func)(void*), void* data)
return 0;
}
int int_remove_io_interrupt_handler(int vector, int (*func)(void*), void* data)
int
int_remove_io_interrupt_handler(int vector, int (*func)(void*), void* data)
{
struct io_handler *io, *prev = NULL;
int state;
@@ -86,7 +94,7 @@ int int_remove_io_interrupt_handler(int vector, int (*func)(void*), void* data)
io = io_vectors[vector].handler_list;
// while not at end
while(io != NULL) {
while (io != NULL) {
// see if we match both the function & data
if (io->func == func && io->data == data)
break;
@@ -120,22 +128,24 @@ int int_remove_io_interrupt_handler(int vector, int (*func)(void*), void* data)
return (io != NULL) ? 0 : EINVAL;
}
int int_io_interrupt_handler(int vector)
int
int_io_interrupt_handler(int vector)
{
int ret = INT_NO_RESCHEDULE;
acquire_spinlock(&io_vectors[vector].vector_lock);
if(io_vectors[vector].handler_list == NULL) {
if (io_vectors[vector].handler_list == NULL) {
dprintf("unhandled io interrupt %d\n", vector);
} else {
struct io_handler *io;
int temp_ret;
io = io_vectors[vector].handler_list;
while(io != NULL) {
while (io != NULL) {
temp_ret = io->func(io->data);
if(temp_ret == INT_RESCHEDULE)
if (temp_ret == INT_RESCHEDULE)
ret = INT_RESCHEDULE;
io = io->next;
}