diff -ruN kozos41/extintr.c kozos42/extintr.c --- kozos41/extintr.c Thu Feb 26 22:57:59 2009 +++ kozos42/extintr.c Sun Mar 1 22:37:36 2009 @@ -9,6 +9,7 @@ #include "extsub.h" #define USE_MESSAGE +/* #define INTERRUPT_PRIORITY */ #define BUFFER_SIZE 1024 @@ -16,8 +17,10 @@ static int control_fd; /* 子プロセスへの制御用 */ -static int intrpri_current = 0; +static int intrpri_current = EXTINTR_INTERRUPTS_NUM; +#ifdef INTERRUPT_PRIORITY static int intrpri_old = 0; +#endif static struct timerreg { int read_fd; /* 子プロセスからの転送用 */ @@ -152,6 +155,7 @@ return 0; } +#ifdef INTERRUPT_PRIORITY static struct interrupts *interrupts_search(int id) { int i; @@ -162,7 +166,9 @@ } return NULL; } +#endif +#ifdef INTERRUPT_PRIORITY static void preproc(int id) { struct interrupts *intp; @@ -222,11 +228,14 @@ return; } +#endif +#ifdef INTERRUPT_PRIORITY static void allmask(int id) { preproc(0); } +#endif static int timer_mask(struct interrupts *intp) { @@ -269,7 +278,9 @@ switch (command[0]) { case EXTINTR_CMD_TIMER_USE: intp->id = id; +#ifdef INTERRUPT_PRIORITY kz_precall(id, preproc); +#endif break; case EXTINTR_CMD_TIMER_START: @@ -359,7 +370,9 @@ switch (command[0]) { case EXTINTR_CMD_CONSOLE_USE: /* コンソールの利用 */ intp->id = id; +#ifdef INTERRUPT_PRIORITY kz_precall(id, preproc); +#endif break; case EXTINTR_CMD_CONSOLE_ENABLE: @@ -412,7 +425,9 @@ continue; if (intp->checkintr(intp)) { intp->intr(intp); +#ifdef INTERRUPT_PRIORITY break; +#endif } } return; @@ -499,8 +514,10 @@ extintr_intr_regist(&interrupts[6], &timerreg[3], timer_init); extintr_intr_regist(&interrupts[7], & consreg[3], cons_init); +#ifdef INTERRUPT_PRIORITY kz_precall(0, preproc); kz_precall(kz_getid(), allmask); +#endif extintr_mainloop();