Changeset c7c0b89b in mainline
- Timestamp:
- 2006-04-22T18:05:16Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 613bc54
- Parents:
- 68091bd
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/cpu.h
r68091bd rc7c0b89b 30 30 #define __amd64_CPU_H__ 31 31 32 #define RFLAGS_IF (1 << 9) 32 33 #define RFLAGS_RF (1 << 16) 33 34 -
arch/amd64/src/asm_utils.S
r68091bd rc7c0b89b 244 244 sti 245 245 movq %r9, %rcx # Exchange last parameter as a third 246 247 cmp $2, %r8 # Is this SYS_INT_CONTROL 248 je sys_int_ctrl 249 246 250 call syscall_handler 251 sys_end: 247 252 cli # We will be touching stack pointer 248 253 … … 251 256 movq 0(%rsp), %rsp 252 257 sysretq 258 259 sys_int_ctrl: 260 mov %rsp, %rsi # Pointer to flags 261 call ddi_int_control 262 jmp sys_end 263 253 264 254 265 .data -
arch/amd64/src/ddi/ddi.c
r68091bd rc7c0b89b 35 35 #include <arch/pm.h> 36 36 #include <errno.h> 37 #include <arch/cpu.h> 37 38 38 39 /** Enable I/O space range for task. … … 91 92 return 0; 92 93 } 94 95 /** Enable/disable interrupts form syscall 96 * 97 * @param enable If non-zero, interrupts are enabled, otherwise disabled 98 * @param flags CP0 flags register 99 */ 100 __native ddi_int_control_arch(__native enable, __native *flags) 101 { 102 if (enable) 103 *flags |= RFLAGS_IF; 104 else 105 *flags &= ~RFLAGS_IF; 106 return 0; 107 } -
arch/amd64/src/mm/page.c
r68091bd rc7c0b89b 169 169 if (!as_page_fault(page)) { 170 170 print_info_errcode(n, istate); 171 printf("Page fault address: % Q\n", page);171 printf("Page fault address: %llX\n", page); 172 172 panic("page fault\n"); 173 173 } -
arch/ia32/include/cpu.h
r68091bd rc7c0b89b 34 34 #include <arch/asm.h> 35 35 36 #define EFLAGS_IF (1 << 9) 36 37 #define EFLAGS_RF (1 << 16) 37 38 -
arch/ia32/src/asm.S
r68091bd rc7c0b89b 87 87 # and call exc_dispatch(). 88 88 # 89 #define INTERRUPT_ALIGN 6489 #define INTERRUPT_ALIGN 128 90 90 .macro handler i n 91 91 … … 109 109 110 110 sti 111 cmp $2, %edi # Is this SYS_INT_CONTROL? 112 je sys_int_ctrl 113 111 114 call syscall_handler # syscall_handler(ax,cx,dx,si,di) 115 sysc_end: 112 116 cli 113 117 addl $20, %esp # clean-up of parameters … … 120 124 CLEAR_NT_FLAG 121 125 iret 126 sys_int_ctrl: # Interrupt control 127 mov %esp, %eax 128 add $44, %eax 129 mov %eax, 4(%esp) # Pointer to flags - 2nd argument 130 call ddi_int_control 131 jmp sysc_end 122 132 .else 123 133 /* -
arch/ia32/src/ddi/ddi.c
r68091bd rc7c0b89b 35 35 #include <arch/pm.h> 36 36 #include <errno.h> 37 #include <arch/cpu.h> 37 38 38 39 /** Enable I/O space range for task. … … 91 92 return 0; 92 93 } 94 95 /** Enable/disable interrupts form syscall 96 * 97 * @param enable If non-zero, interrupts are enabled, otherwise disabled 98 * @param flags CP0 flags register 99 */ 100 __native ddi_int_control_arch(__native enable, __native *flags) 101 { 102 if (enable) 103 *flags |= EFLAGS_IF; 104 else 105 *flags &= ~EFLAGS_IF; 106 return 0; 107 } -
arch/mips32/src/ddi/ddi.c
r68091bd rc7c0b89b 31 31 #include <arch/types.h> 32 32 #include <typedefs.h> 33 #include <security/cap.h> 34 #include <arch.h> 35 #include <arch/cp0.h> 33 36 34 37 /** Enable I/O space range for task. … … 46 49 return 0; 47 50 } 51 52 /** Enable/disable interrupts form syscall 53 * 54 * @param enable If non-zero, interrupts are enabled, otherwise disabled 55 * @param flags CP0 flags register 56 */ 57 __native ddi_int_control_arch(__native enable, __native *flags) 58 { 59 if (enable) 60 *flags |= cp0_status_ie_enabled_bit; 61 else 62 *flags &= ~cp0_status_ie_enabled_bit; 63 return 0; 64 } -
arch/mips32/src/start.S
r68091bd rc7c0b89b 252 252 mtc0 $t0, $status 253 253 254 li $t4, 2 # SYS_INT_CONTROL 255 beq $t4, $v0, sysc_int_control 256 nop 257 254 258 # CALL Syscall handler 255 259 jal syscall_handler 256 260 sw $v0, SS_ARG4($sp) # save v0 - arg4 to stack 257 261 262 sysc_exit: 258 263 # restore status 259 264 mfc0 $t0, $status … … 276 281 eret 277 282 283 sysc_int_control: 284 jal ddi_int_control 285 addi $a1, $sp, SS_STATUS 286 287 j sysc_exit 288 nop 289 278 290 tlb_refill_handler: 279 291 KERNEL_STACK_TO_K0 -
generic/include/ddi/ddi.h
r68091bd rc7c0b89b 40 40 * Interface to be implemented by all architectures. 41 41 */ 42 extern __native ddi_int_control_arch(__native enable, __native *flags); 43 extern __native ddi_int_control(__native enable, __native *flags); 42 44 extern int ddi_enable_iospace_arch(task_t *task, __address ioaddr, size_t size); 43 45 -
generic/include/security/cap.h
r68091bd rc7c0b89b 58 58 #define CAP_IO_MANAGER (1<<2) 59 59 60 /** 61 * CAP_INT_CONTROL allows its holder to disable interrupts 62 */ 63 #define CAP_INT_CONTROL (1<<3) 64 60 65 typedef __u32 cap_t; 61 66 -
generic/include/syscall/syscall.h
r68091bd rc7c0b89b 33 33 SYS_IO = 0, 34 34 SYS_TLS_SET = 1, /* Hardcoded in AMD64,IA32 uspace - psthread.S */ 35 SYS_INT_CONTROL = 2, /* Hardcoded in all SYSCALL handlers */ 35 36 SYS_THREAD_CREATE, 36 37 SYS_THREAD_EXIT, -
generic/src/ddi/ddi.c
r68091bd rc7c0b89b 195 195 return (__native) ddi_enable_iospace((task_id_t) arg.task_id, (__address) arg.ioaddr, (size_t) arg.size); 196 196 } 197 198 __native ddi_int_control(__native enable, __native *flags) 199 { 200 if (! cap_get(TASK) & CAP_INT_CONTROL) 201 return EPERM; 202 return ddi_int_control_arch(enable, flags); 203 } 204 -
generic/src/syscall/syscall.c
r68091bd rc7c0b89b 65 65 } 66 66 67 static __native sys_int_control(int enable) 68 { 69 panic("Not implemented."); 70 } 71 67 72 /** Dispatch system call */ 68 73 __native syscall_handler(__native a1, __native a2, __native a3, … … 78 83 sys_io, 79 84 sys_tls_set, 85 sys_int_control, 80 86 sys_thread_create, 81 87 sys_thread_exit,
Note:
See TracChangeset
for help on using the changeset viewer.