- Timestamp:
- Jun 29, 2017, 3:48:39 PM (8 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_cpu.S
r98 r99 91 91 ret 92 92 93 ASM_ENTRY(rcr2) 94 movq %cr2,%rax 95 ret 96 93 97 ASM_ENTRY(x86_stop) /* debug only */ 94 98 int $0x0b -
trunk/hal/x86_64/core/hal_init.c
r94 r99 28 28 #include <hal_internal.h> 29 29 #include <hal_remote.h> 30 #include <hal_irqmask.h> 30 31 31 32 #include <memcpy.h> … … 181 182 xptr_t myptr = XPTR(0, &mytest); 182 183 183 hal_remote_atomic_add(myptr, 3);184 x86_printf("-> mytest = %z\n", mytest);185 186 184 hal_remote_spt(myptr, hoho); 187 185 x86_printf("-> mytest = %Z\n", hal_remote_lpt(myptr)); 188 186 189 190 187 init_bootinfo(&btinfo); 188 189 reg_t dummy; 190 hal_enable_irq(&dummy); 191 191 192 kernel_init(&btinfo); 193 192 194 x86_printf("[+] kernel_init called\n"); 195 196 while (1); 193 197 194 198 // void x86_stop(); 195 199 // x86_stop(); 196 197 sti();198 while (1);199 200 200 201 int m = 0; -
trunk/hal/x86_64/core/hal_internal.h
r98 r99 40 40 uint64_t rdmsr(uint32_t); 41 41 void wrmsr(uint32_t, uint64_t); 42 vaddr_t rcr2(void); 42 43 43 44 uint32_t atomic_cas_32(volatile uint32_t *ptr, uint32_t exp, uint32_t new); -
trunk/hal/x86_64/core/hal_irqmask.c
r51 r99 1 1 /* 2 * hal_irqmask.c - implementation of Generic IRQ Masking API for TSAR-MIPS32 3 * 4 * Author Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016) 2 * hal_irqmask.c - implementation of Generic IRQ Masking API for x86 6 3 * 7 * Copyright (c) UPMC Sorbonne Universites 8 * 9 * This file is part of ALMOS-MKH.. 4 * Copyright (c) 2017 Maxime Villard 10 5 * 11 * ALMOS-MKH. is free software; you can redistribute it and/or modify it 6 * This file is part of ALMOS-MKH. 7 * 8 * ALMOS-MKH is free software; you can redistribute it and/or modify it 12 9 * under the terms of the GNU General Public License as published by 13 10 * the Free Software Foundation; version 2.0 of the License. 14 11 * 15 * ALMOS-MKH .is distributed in the hope that it will be useful, but12 * ALMOS-MKH is distributed in the hope that it will be useful, but 16 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 17 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU … … 26 23 #include <hal_internal.h> 27 24 28 inline void hal_disable_irq( uint32_t * old ) 25 static int interrupts_enabled __in_kdata = 0; 26 27 inline void hal_disable_irq(uint32_t *old) 28 { 29 if (!interrupts_enabled) { 30 x86_panic("nested critical sections forbidden"); 31 } 32 interrupts_enabled = 0; 33 cli(); 34 } 35 36 inline void hal_enable_irq(uint32_t *old) 37 { 38 if (interrupts_enabled) { 39 x86_panic("nested critical sections forbidden"); 40 } 41 interrupts_enabled = 1; 42 sti(); 43 } 44 45 inline void hal_restore_irq(uint32_t old) 29 46 { 30 47 x86_panic((char *)__func__); 31 48 } 32 49 33 inline void hal_enable_irq( uint32_t * old )34 {35 x86_panic((char *)__func__);36 }37 38 inline void hal_restore_irq( uint32_t old )39 {40 x86_panic((char *)__func__);41 }42 -
trunk/hal/x86_64/core/hal_trap.c
r91 r99 69 69 x86_printf("-> rsp = %Z\n", tf->tf_rsp); 70 70 x86_printf("-> err = %Z\n", tf->tf_err); 71 if (trapno == T_PAGEFLT) 72 x86_printf("-> va = %Z\n", rcr2()); 71 73 x86_printf("****** FAULT OCCURRED ******\n\n"); 72 74
Note: See TracChangeset
for help on using the changeset viewer.