//kernel/trunk/arch/ia32/include/cpu.h |
---|
33,6 → 33,7 |
#include <arch/pm.h> |
#include <arch/asm.h> |
#define EFLAGS_IF (1 << 9) |
#define EFLAGS_RF (1 << 16) |
struct cpu_arch { |
//kernel/trunk/arch/ia32/src/asm.S |
---|
86,7 → 86,7 |
# The handlers setup data segment registers |
# and call exc_dispatch(). |
# |
#define INTERRUPT_ALIGN 64 |
#define INTERRUPT_ALIGN 128 |
.macro handler i n |
.ifeq \i-0x30 # Syscall handler |
108,7 → 108,11 |
movw %ax,%es |
sti |
cmp $2, %edi # Is this SYS_INT_CONTROL? |
je sys_int_ctrl |
call syscall_handler # syscall_handler(ax,cx,dx,si,di) |
sysc_end: |
cli |
addl $20, %esp # clean-up of parameters |
119,6 → 123,12 |
CLEAR_NT_FLAG |
iret |
sys_int_ctrl: # Interrupt control |
mov %esp, %eax |
add $44, %eax |
mov %eax, 4(%esp) # Pointer to flags - 2nd argument |
call ddi_int_control |
jmp sysc_end |
.else |
/* |
* This macro distinguishes between two versions of ia32 exceptions. |
//kernel/trunk/arch/ia32/src/ddi/ddi.c |
---|
34,6 → 34,7 |
#include <mm/slab.h> |
#include <arch/pm.h> |
#include <errno.h> |
#include <arch/cpu.h> |
/** Enable I/O space range for task. |
* |
90,3 → 91,17 |
return 0; |
} |
/** Enable/disable interrupts form syscall |
* |
* @param enable If non-zero, interrupts are enabled, otherwise disabled |
* @param flags CP0 flags register |
*/ |
__native ddi_int_control_arch(__native enable, __native *flags) |
{ |
if (enable) |
*flags |= EFLAGS_IF; |
else |
*flags &= ~EFLAGS_IF; |
return 0; |
} |