/kernel/trunk/arch/amd64/include/cpu.h |
---|
29,6 → 29,7 |
#ifndef __amd64_CPU_H__ |
#define __amd64_CPU_H__ |
#define RFLAGS_IF (1 << 9) |
#define RFLAGS_RF (1 << 16) |
#define EFER_MSR_NUM 0xc0000080 |
/kernel/trunk/arch/amd64/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 |= RFLAGS_IF; |
else |
*flags &= ~RFLAGS_IF; |
return 0; |
} |
/kernel/trunk/arch/amd64/src/asm_utils.S |
---|
243,7 → 243,12 |
sti |
movq %r9, %rcx # Exchange last parameter as a third |
cmp $2, %r8 # Is this SYS_INT_CONTROL |
je sys_int_ctrl |
call syscall_handler |
sys_end: |
cli # We will be touching stack pointer |
popq %r11 |
250,6 → 255,12 |
popq %rcx |
movq 0(%rsp), %rsp |
sysretq |
sys_int_ctrl: |
mov %rsp, %rsi # Pointer to flags |
call ddi_int_control |
jmp sys_end |
.data |
.global interrupt_handler_size |
/kernel/trunk/arch/amd64/src/mm/page.c |
---|
168,7 → 168,7 |
page = read_cr2(); |
if (!as_page_fault(page)) { |
print_info_errcode(n, istate); |
printf("Page fault address: %Q\n", page); |
printf("Page fault address: %llX\n", page); |
panic("page fault\n"); |
} |
} |
/kernel/trunk/arch/mips32/src/start.S |
---|
251,10 → 251,15 |
sw $t2,SS_STATUS($sp) |
mtc0 $t0, $status |
li $t4, 2 # SYS_INT_CONTROL |
beq $t4, $v0, sysc_int_control |
nop |
# CALL Syscall handler |
jal syscall_handler |
sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack |
sysc_exit: |
# restore status |
mfc0 $t0, $status |
lw $t1,SS_STATUS($sp) |
275,6 → 280,13 |
eret |
sysc_int_control: |
jal ddi_int_control |
addi $a1, $sp, SS_STATUS |
j sysc_exit |
nop |
tlb_refill_handler: |
KERNEL_STACK_TO_K0 |
sub $k0, REGISTER_SPACE |
/kernel/trunk/arch/mips32/src/ddi/ddi.c |
---|
30,6 → 30,9 |
#include <proc/task.h> |
#include <arch/types.h> |
#include <typedefs.h> |
#include <security/cap.h> |
#include <arch.h> |
#include <arch/cp0.h> |
/** Enable I/O space range for task. |
* |
45,3 → 48,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 |= cp0_status_ie_enabled_bit; |
else |
*flags &= ~cp0_status_ie_enabled_bit; |
return 0; |
} |
/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; |
} |