Changeset 94 for trunk/hal/x86_64
- Timestamp:
- Jun 29, 2017, 1:27:43 PM (8 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_cpu.S
r91 r94 56 56 ret 57 57 58 ASM_ENTRY(rdtsc) 59 xorq %rax,%rax 60 rdtsc 61 shlq $32,%rdx 62 orq %rdx,%rax 63 ret 64 58 65 ASM_ENTRY(in8) 59 66 movq %rdi,%rdx … … 88 95 ret 89 96 97 /* -------------------------------------------------------------------------- */ 98 99 ASM_ENTRY(atomic_cas_32) 100 movl %esi,%eax 101 lock 102 cmpxchgl %edx,(%rdi) 103 /* %eax now contains the old value */ 104 ret 105 106 ASM_ENTRY(atomic_add_32) 107 lock 108 addl %esi,(%rdi) 109 ret 110 -
trunk/hal/x86_64/core/hal_drivers.c
r77 r94 27 27 void hal_drivers_txt_init(chdev_t *dev) 28 28 { 29 x86_panic((char *)__func__);29 soclib_tty_init(dev); 30 30 } 31 31 -
trunk/hal/x86_64/core/hal_init.c
r86 r94 178 178 179 179 x86_printf("-> mytest = %z\n", mytest); 180 180 void *hoho = &init_x86_64; 181 181 xptr_t myptr = XPTR(0, &mytest); 182 hal_remote_sb(myptr, 1); 183 x86_printf("-> mytest = %z\n", hal_remote_lb(myptr)); 182 183 hal_remote_atomic_add(myptr, 3); 184 x86_printf("-> mytest = %z\n", mytest); 185 186 hal_remote_spt(myptr, hoho); 187 x86_printf("-> mytest = %Z\n", hal_remote_lpt(myptr)); 188 184 189 185 190 init_bootinfo(&btinfo); -
trunk/hal/x86_64/core/hal_internal.h
r91 r94 35 35 void sti(); 36 36 void cli(); 37 uint64_t rdtsc(); 37 38 uint8_t in8(uint32_t port); 38 39 void out8(uint32_t port, uint8_t val); 39 40 uint64_t rdmsr(uint32_t); 40 41 void wrmsr(uint32_t, uint64_t); 42 43 uint32_t atomic_cas_32(volatile uint32_t *ptr, uint32_t exp, uint32_t new); 44 void atomic_add_32(volatile uint32_t *ptr, int32_t incr); 41 45 42 46 /* hal_gpt.c */ … … 55 59 /* x86_printf.c */ 56 60 void x86_panic(char *msg); 61 void x86_putc(char c); 57 62 void x86_printf(char *s, ...); 58 63 -
trunk/hal/x86_64/core/hal_remote.c
r92 r94 70 70 } 71 71 72 uint32_t hal_remote_lw_unc( xptr_t xp )73 {74 x86_panic((char *)__func__);75 return 0;76 }77 78 72 bool_t hal_remote_atomic_cas( xptr_t xp, 79 73 uint32_t old, 80 74 uint32_t new ) 81 75 { 82 x86_panic((char *)__func__); 83 return 0; 76 return atomic_cas_32((volatile uint32_t *)xp, old, new); 84 77 } 85 78 86 79 uint32_t hal_remote_atomic_add( xptr_t xp, 87 uint32_t incr ) 80 uint32_t incr ) // XXX define as signed 88 81 { 89 x86_panic((char *)__func__); 90 return 0; 82 atomic_add_32((volatile uint32_t *)xp, incr); 91 83 } 92 84 -
trunk/hal/x86_64/core/hal_special.c
r82 r94 75 75 uint32_t hal_time_stamp() 76 76 { 77 x86_panic((char *)__func__); 78 return 0; 77 return (uint32_t)rdtsc(); // XXX will be fixed soon 79 78 } 80 79 81 80 struct thread_s * hal_get_current_thread() 82 81 { 83 x86_panic((char *)__func__);84 82 return curcpu()->ci_thr; 85 83 } -
trunk/hal/x86_64/core/x86_printf.c
r90 r94 74 74 } 75 75 76 staticvoid x86_putc(char c)76 void x86_putc(char c) 77 77 { 78 78 if (c == '\n') {
Note: See TracChangeset
for help on using the changeset viewer.