{install|remove}_io_interrupt_handler() now correctly handle the B_NO_ENABLE_COUNTER flag.

Lots of cleanup:
- moved B_NO_ENABLE_COUNTER flag definition out of int.h to KernelExport.h, as it's
  described in the BeBook (although it's probably not really used that often :))
- int.c no longer has any platform dependent code (+ 0x20 on interrupt numbers is gone);
  it's now entirely handled in the arch/x86/ section.
- the io_vectors[] is now statically initialized, instead of allocated from the heap
- removed {install|remove}_interrupt_handler(); they weren't that useful, arch_smp_init()
  is now calling install_io_interrupt_handler() correctly instead
- introduced a new arch_int.h header file that currently contains NUM_IO_VECTORS only
  (though on x86, it also has ARCH_INTERRUPT_BASE == 0x20).
- changed the return type from {install|remove}_io_interrupt_handler() from "long" to
  "status_t"
- rearranged and cleaned the PIC initialization code, made the PIC code more prominent
- changed comments that talk about a non existing 8239 (the PIC chip is actually 8259)
- moved arch/x86/interrupts.h to the source directory, as it's not used outside
- added BeOS compatible interrupts_enabled() function, that should replace our
  equivalent (and private) are_interrupts_enabled()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12477 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-04-27 01:08:35 +00:00
parent a38e60f223
commit b20667b35b
12 changed files with 239 additions and 160 deletions
+7 -6
View File
@@ -1,15 +1,16 @@
/*
** Copyright 2002-2004, The Haiku Team. All rights reserved.
** Distributed under the terms of the Haiku License.
**
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
* Copyright 2002-2005, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
* Distributed under the terms of the NewOS License.
*/
#ifndef KERNEL_ARCH_INT_H
#define KERNEL_ARCH_INT_H
#include <boot/kernel_args.h>
#include <arch_int.h>
#ifdef __cplusplus
@@ -0,0 +1,12 @@
/*
* Copyright 2005, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_PPC_INT_H
#define _KERNEL_ARCH_PPC_INT_H
#define NUM_IO_VECTORS 256
#endif /* _KERNEL_ARCH_PPC_INT_H */
@@ -0,0 +1,13 @@
/*
* Copyright 2005, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_x86_INT_H
#define _KERNEL_ARCH_x86_INT_H
#define ARCH_INTERRUPT_BASE 0x20
#define NUM_IO_VECTORS (256 - ARCH_INTERRUPT_BASE)
#endif /* _KERNEL_ARCH_x86_INT_H */
@@ -1,21 +0,0 @@
/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_I386_INTERRUPTS_H
#define _NEWOS_KERNEL_ARCH_I386_INTERRUPTS_H
void trap0();void trap1();void trap2();void trap3();void trap4();void trap5();
void trap6();void trap7();void trap9();void trap10();void trap11();
void trap12();void trap13();void trap14();void trap16();void trap17();void trap18();
void trap32();void trap33();void trap34();void trap35();void trap36();void trap37();
void trap38();void trap39();void trap40();void trap41();void trap42();void trap43();
void trap44();void trap45();void trap46();void trap47();
void double_fault(); // int 8
void trap99();
void trap251();void trap252();void trap253();void trap254();void trap255();
#endif
+2 -6
View File
@@ -15,10 +15,6 @@
struct kernel_args;
/* adds the handler but don't change whether or not the interrupt is currently enabled */
#define B_NO_ENABLE_COUNTER 1
#ifdef __cplusplus
extern "C" {
#endif
@@ -26,8 +22,8 @@ extern "C" {
status_t int_init(struct kernel_args *args);
status_t int_init_post_vm(struct kernel_args *args);
int int_io_interrupt_handler(int vector);
status_t install_interrupt_handler(long vector, interrupt_handler, void *data);
status_t remove_interrupt_handler(long vector, interrupt_handler, void *data);
bool interrupts_enabled(void);
static inline void
enable_interrupts(void)