Changeset 145 for trunk/hal/x86_64
- Timestamp:
- Jul 5, 2017, 11:05:11 AM (7 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_acpi.h
r89 r145 1 1 /* 2 2 * hal_acpi.h - ACPI-specific values and structures 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 5 * Inspired by ACPICA. 6 * 6 * 7 7 * This file is part of ALMOS-MKH. 8 8 * -
trunk/hal/x86_64/core/hal_apic.c
r138 r145 227 227 228 228 /* Initialize the LAPIC timer to the maximum value */ 229 hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF); 229 hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF); 230 230 231 231 /* Initialize the PIT */ -
trunk/hal/x86_64/core/hal_atomic.c
r105 r145 23 23 #include <hal_internal.h> 24 24 25 void hal_atomic_and( uint32_t * ptr, 26 int32_t val ) 25 void hal_atomic_and(uint32_t *ptr, int32_t val) 27 26 { 28 27 atomic_and_32((volatile uint32_t *)ptr, val); 29 28 } 30 29 31 void hal_atomic_or( uint32_t * ptr, 32 int32_t val ) 30 void hal_atomic_or(uint32_t *ptr, int32_t val) 33 31 { 34 32 atomic_or_32((volatile uint32_t *)ptr, val); 35 33 } 36 34 37 uint32_t hal_atomic_add( void * ptr, 38 int32_t val ) 35 uint32_t hal_atomic_add(void *ptr, int32_t val) 39 36 { 40 37 return atomic_add_32((volatile uint32_t *)ptr, val); 41 38 } 42 39 43 bool_t hal_atomic_cas( uint32_t * ptr, 44 uint32_t old, 45 uint32_t new ) 40 bool_t hal_atomic_cas(uint32_t *ptr, uint32_t old, uint32_t new) 46 41 { 47 42 return (atomic_cas_32((volatile uint32_t *)ptr, old, new) == old); 48 43 } 49 44 50 bool_t hal_atomic_test_set( uint32_t * ptr, 51 int32_t val ) 45 bool_t hal_atomic_test_set(uint32_t *ptr, int32_t val) 52 46 { 53 47 x86_panic((char *)__func__); -
trunk/hal/x86_64/core/hal_boot.S
r51 r145 1 1 /* 2 2 * hal_boot.S - Kernel boot entry point 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 5 * This code is inspired a lot from the NetBSD boot procedure, written by -
trunk/hal/x86_64/core/hal_boot.h
r111 r145 1 1 /* 2 2 * hal_boot.h - General values used by the boot procedure 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_cpu.S
r125 r145 1 1 /* 2 2 * hal_cpu.S - Miscellaneous CPU functions 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_gpt.c
r134 r145 257 257 uint32_t GPT_SMALL; 258 258 uint32_t GPT_READABLE; 259 uint32_t GPT_WRITABLE; 259 uint32_t GPT_WRITABLE; 260 260 uint32_t GPT_EXECUTABLE; 261 uint32_t GPT_CACHABLE; 262 uint32_t GPT_USER; 261 uint32_t GPT_CACHABLE; 262 uint32_t GPT_USER; 263 263 uint32_t GPT_DIRTY; 264 264 uint32_t GPT_ACCESSED; -
trunk/hal/x86_64/core/hal_internal.h
r125 r145 1 1 /* 2 2 * hal_internal.h - x86-specific function definitions 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_kentry.S
r142 r145 1 1 /* 2 * hal_kentry.S - Entry points into the kernel ( traps, interrupts,syscalls)3 * 2 * hal_kentry.S - Entry points into the kernel (exceptions/interrupts/syscalls) 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_kentry.h
r138 r145 1 1 /* 2 2 * hal_kentry.h - General values used in the different kernel entries 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_multiboot.h
r51 r145 1 1 /* 2 2 * hal_multiboot.h - Multiboot-specific values and structures 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_register.h
r82 r145 1 1 /* 2 2 * hal_register.h - Values available in some x86 registers 3 * 3 * 4 4 * Copyright (c) 2017 Maxime Villard 5 * 5 * 6 6 * This file is part of ALMOS-MKH. 7 7 * -
trunk/hal/x86_64/core/hal_remote.c
r124 r145 23 23 #include <hal_internal.h> 24 24 25 void hal_remote_sb( xptr_t xp, 26 uint8_t data ) 25 void hal_remote_sb(xptr_t xp, uint8_t data) 27 26 { 28 27 *(uint8_t *)xp = data; 29 28 } 30 29 31 void hal_remote_sw( xptr_t xp, 32 uint32_t data ) 30 void hal_remote_sw(xptr_t xp, uint32_t data) 33 31 { 34 32 *(uint32_t *)xp = data; 35 33 } 36 34 37 void hal_remote_swd( xptr_t xp, 38 uint64_t data ) 35 void hal_remote_swd(xptr_t xp, uint64_t data) 39 36 { 40 37 *(uint64_t *)xp = data; 41 38 } 42 39 43 void hal_remote_spt( xptr_t xp, 44 void * pt ) 40 void hal_remote_spt(xptr_t xp, void *pt) 45 41 { 46 hal_remote_swd( xp , (uint64_t)pt);42 hal_remote_swd(xp, (uint64_t)pt); 47 43 } 48 44 49 uint8_t hal_remote_lb( xptr_t xp)45 uint8_t hal_remote_lb(xptr_t xp) 50 46 { 51 47 return *(uint8_t *)xp; 52 48 } 53 49 54 uint32_t hal_remote_lw( xptr_t xp)50 uint32_t hal_remote_lw(xptr_t xp) 55 51 { 56 52 return *(uint32_t *)xp; 57 53 } 58 54 59 uint64_t hal_remote_lwd( xptr_t xp)55 uint64_t hal_remote_lwd(xptr_t xp) 60 56 { 61 57 return *(uint64_t *)xp; 62 58 } 63 59 64 void *hal_remote_lpt( xptr_t xp)60 void *hal_remote_lpt(xptr_t xp) 65 61 { 66 return (void *)hal_remote_lwd( xp);62 return (void *)hal_remote_lwd(xp); 67 63 } 68 64 69 bool_t hal_remote_atomic_cas( xptr_t xp, 70 uint32_t old, 71 uint32_t new ) 65 bool_t hal_remote_atomic_cas(xptr_t xp, uint32_t old, uint32_t new) 72 66 { 73 67 return (atomic_cas_32((volatile uint32_t *)xp, old, new) == old); 74 68 } 75 69 76 uint32_t hal_remote_atomic_add( xptr_t xp, 77 uint32_t incr ) // XXX define as signed 70 uint32_t hal_remote_atomic_add(xptr_t xp, uint32_t incr) 78 71 { 79 72 return atomic_add_32((volatile uint32_t *)xp, incr); 80 73 } 81 74 82 uint32_t hal_remote_atomic_and( xptr_t xp, 83 uint32_t mask ) 75 uint32_t hal_remote_atomic_and(xptr_t xp, uint32_t mask) 84 76 { 85 77 return atomic_and_32((volatile uint32_t *)xp, mask); 86 78 } 87 79 88 uint32_t hal_remote_atomic_or( xptr_t xp, 89 uint32_t mask ) 80 uint32_t hal_remote_atomic_or(xptr_t xp, uint32_t mask) 90 81 { 91 82 return atomic_or_32((volatile uint32_t *)xp, mask); 92 83 } 93 84 94 error_t hal_remote_atomic_try_add( xptr_t xp, 95 uint32_t incr, 96 uint32_t * old ) 85 error_t hal_remote_atomic_try_add(xptr_t xp, uint32_t incr, uint32_t *old) 97 86 { 98 87 x86_panic((char *)__func__); … … 100 89 } 101 90 102 void hal_remote_memcpy( xptr_t dst, 103 xptr_t src, 104 uint32_t size ) 91 void hal_remote_memcpy(xptr_t dst, xptr_t src, uint32_t size) 105 92 { 106 93 memcpy((void *)dst, (void *)src, size); -
trunk/hal/x86_64/core/hal_syscall.c
r51 r145 1 1 /* 2 2 * hal_syscall.c - Implementation of syscall handler for TSAR-MIPS32. 3 * 3 * 4 4 * Author Alain Greiner (2016,2017) 5 5 * -
trunk/hal/x86_64/core/hal_types.h
r73 r145 38 38 39 39 /************************************************************************** 40 * Exact-width integer types. 40 * Exact-width integer types. 41 41 **************************************************************************/ 42 42 … … 59 59 60 60 /*************************************************************************** 61 * Pthread related types 62 **************************************************************************/ 63 64 typedef uint32_t pthread_t; 61 * Pthread related types 62 **************************************************************************/ 63 64 typedef uint32_t pthread_t; 65 65 typedef uint32_t pthread_mutexattr_t; 66 66 typedef uint32_t pthread_barrier_t; … … 95 95 96 96 /*************************************************************************** 97 * Global Process identifier type / fixed format 97 * Global Process identifier type / fixed format 98 98 * 16 MSB = cluster XY identifier 99 99 * 16 LSB = local process index 100 100 **************************************************************************/ 101 101 102 typedef uint32_t pid_t; 103 104 /*************************************************************************** 105 * Local Process index 102 typedef uint32_t pid_t; 103 104 /*************************************************************************** 105 * Local Process index 106 106 **************************************************************************/ 107 107 … … 109 109 110 110 /*************************************************************************** 111 * Thread identifier type / fixed format 111 * Thread identifier type / fixed format 112 112 * 16 MSB = cluster XY identifier 113 113 * 16 LSB = local thread index … … 117 117 118 118 /*************************************************************************** 119 * Local Thread index 119 * Local Thread index 120 120 **************************************************************************/ 121 121 … … 142 142 143 143 /*************************************************************************** 144 * This structure defines a single 32 bits integer alone in a cache line. 144 * This structure defines a single 32 bits integer alone in a cache line. 145 145 **************************************************************************/ 146 146 -
trunk/hal/x86_64/core/hal_uspace.c
r51 r145 1 1 /* 2 2 * hal_uspace.c - implementation of Generic User Space Access API for MIPS32 3 * 3 * 4 4 * Author Mohamed Karaoui (2015) 5 5 * Alain Greiner (2016) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites 8 * 8 * 9 9 * This file is part of ALMOS-MKH.. 10 10 * -
trunk/hal/x86_64/core/x86_printf.c
r94 r145 2 2 * x86_printf.c - A printf function for x86 (debug only). 3 3 * 4 * Copyright (c) [don't know exactly, found on the internet... anyway, this 5 * file will be removed soon...] 4 * Copyright (c) 2017 Maxime Villard 6 5 * 7 6 * This file is part of ALMOS-MKH. … … 255 254 } else if (c == 's') { 256 255 x86_printf((char *) va_arg(ap, uint64_t)); 257 } 256 } 258 257 } else 259 258 x86_putc(c);
Note: See TracChangeset
for help on using the changeset viewer.