Changeset 53f9821 in mainline for arch/amd64
- Timestamp:
- 2006-03-20T20:32:17Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 018d957e
- Parents:
- 9d3e185
- Location:
- arch/amd64
- Files:
-
- 4 edited
-
include/atomic.h (modified) (2 diffs)
-
include/syscall.h (modified) (1 diff)
-
src/interrupt.c (modified) (1 diff)
-
src/syscall.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/atomic.h
r9d3e185 r53f9821 31 31 32 32 #include <arch/types.h> 33 #include <arch/barrier.h> 34 #include <preemption.h> 33 35 34 36 typedef struct { volatile __u64 count; } atomic_t; … … 102 104 103 105 104 extern void spinlock_arch(volatile int *val); 106 /** AMD64 specific fast spinlock */ 107 static inline void atomic_lock_arch(atomic_t *val) 108 { 109 __u64 tmp; 110 111 preemption_disable(); 112 __asm__ volatile ( 113 "0:;" 114 #ifdef CONFIG_HT 115 "pause;" /* Pentium 4's HT love this instruction */ 116 #endif 117 "mov %0, %1;" 118 "testq %1, %1;" 119 "jnz 0b;" /* Leightweight looping on locked spinlock */ 120 121 "incq %1;" /* now use the atomic operation */ 122 "xchgq %0, %1;" 123 "testq %1, %1;" 124 "jnz 0b;" 125 : "=m"(val->count),"=r"(tmp) 126 ); 127 /* 128 * Prevent critical section code from bleeding out this way up. 129 */ 130 CS_ENTER_BARRIER(); 131 } 105 132 106 133 #endif -
arch/amd64/include/syscall.h
r9d3e185 r53f9821 32 32 #include <arch/types.h> 33 33 34 extern __native syscall_handler(__native a1,__native a2, __native a3,35 __native a4, __native id);36 34 extern void syscall_setup_cpu(void); 37 35 -
arch/amd64/src/interrupt.c
r9d3e185 r53f9821 55 55 printf("ERROR_WORD=%Q\n", istate->error_word); 56 56 printf("%%rcs=%Q, flags=%Q, %%cr0=%Q\n", istate->cs, istate->rflags,read_cr0()); 57 printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",istate->rax,istate->rbx,istate->rcx); 58 printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",istate->rdx,istate->rsi,istate->rdi); 59 printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",istate->r8,istate->r9,istate->r10); 60 printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",istate->r11,istate->r12,istate->r13); 61 printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",istate->r14,istate->r15,&istate->stack[0]); 62 printf("%%rbp=%Q\n",istate->rbp); 63 /* 64 printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]); 65 printf(" %Q, %Q, %Q\n", x[8], x[9], x[10]); 66 printf(" %Q, %Q, %Q\n", x[11], x[12], x[13]); 67 printf(" %Q, %Q, %Q\n", x[14], x[15], x[16]); 68 */ 57 printf("%%rax=%Q, %%rcx=%Q, %%rdx=%Q\n",istate->rax,istate->rcx,istate->rdx); 58 printf("%%rsi=%Q, %%rdi=%Q, %%r8 =%Q\n",istate->rsi,istate->rdi,istate->r8); 59 printf("%%r9 =%Q, %%r10 =%Q, %%r11=%Q\n",istate->r9,istate->r10,istate->r11); 60 #ifdef CONFIG_DEBUG_ALLREGS 61 printf("%%r12=%Q, %%r13=%Q, %%r14=%Q\n",istate->r12,istate->r13,istate->r14); 62 printf("%%r15=%Q, %%rbx=%Q, %%rbp=%Q\n",istate->r15,istate->rbx,&istate->rbp); 63 #endif 64 printf("%%rsp=%Q\n",&istate->stack[0]); 69 65 } 70 66 -
arch/amd64/src/syscall.c
r9d3e185 r53f9821 61 61 write_msr(AMD_MSR_SFMASK, 0x200); 62 62 } 63 64 /** Dispatch system call */65 __native syscall_handler(__native a1, __native a2, __native a3,66 __native a4, __native id)67 {68 if (id < SYSCALL_END)69 return syscall_table[id](a1,a2,a3,a4);70 else71 panic("Undefined syscall %d", id);72 }
Note:
See TracChangeset
for help on using the changeset viewer.
