Changeset d364e94 in mainline
- Timestamp:
- 2008-10-02T20:24:01Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d132ae
- Parents:
- c2ad500
- Location:
- kernel/arch/sparc64
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/trap/regwin.h
rc2ad500 rd364e94 40 40 #include <arch/stack.h> 41 41 #include <arch/arch.h> 42 #include <align.h> 42 43 43 44 #define TT_CLEAN_WINDOW 0x24 … … 72 73 #define I6_OFFSET 112 73 74 #define I7_OFFSET 120 75 76 /* Uspace Window Buffer constants. */ 77 #define UWB_SIZE ((NWINDOWS - 1) * STACK_WINDOW_SAVE_AREA_SIZE) 78 #define UWB_ALIGNMENT 1024 79 #define UWB_ASIZE ALIGN_UP(UWB_SIZE, UWB_ALIGNMENT) 74 80 75 81 #ifdef __ASM__ -
kernel/arch/sparc64/src/proc/thread.c
rc2ad500 rd364e94 35 35 #include <proc/thread.h> 36 36 #include <arch/proc/thread.h> 37 #include <mm/frame.h> 38 #include <mm/page.h> 39 #include <arch/mm/page.h> 37 #include <mm/slab.h> 38 #include <arch/trap/regwin.h> 40 39 #include <align.h> 41 40 … … 51 50 { 52 51 if (t->arch.uspace_window_buffer) { 52 uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; 53 53 /* 54 54 * Mind the possible alignment of the userspace window buffer 55 55 * belonging to a killed thread. 56 56 */ 57 frame_free(KA2PA(ALIGN_DOWN((uintptr_t) 58 t->arch.uspace_window_buffer, PAGE_SIZE))); 57 free((uint8_t *) ALIGN_DOWN(uw_buf, UWB_ALIGNMENT)); 59 58 } 60 59 } … … 68 67 * returned from the slab allocator doesn't have any. 69 68 */ 70 t->arch.uspace_window_buffer = frame_alloc(ONE_FRAME, FRAME_KA);69 t->arch.uspace_window_buffer = malloc(UWB_ASIZE, 0); 71 70 } else { 72 71 uintptr_t uw_buf = (uintptr_t) t->arch.uspace_window_buffer; … … 77 76 */ 78 77 t->arch.uspace_window_buffer = (uint8_t *) ALIGN_DOWN(uw_buf, 79 PAGE_SIZE);78 UWB_ASIZE); 80 79 } 81 80 } -
kernel/arch/sparc64/src/trap/trap_table.S
rc2ad500 rd364e94 749 749 */ 750 750 clr %g4 751 set PAGE_SIZE - 1, %g5 752 0: andcc %g7, %g5, %g0 ! PAGE_SIZE alignment check 753 bz 0f ! %g7 is page-aligned, no more windows to refill 751 0: andcc %g7, UWB_ALIGNMENT - 1, %g0 ! alignment check 752 bz 0f ! %g7 is UWB_ALIGNMENT-aligned, no more windows to refill 754 753 nop 755 754
Note:
See TracChangeset
for help on using the changeset viewer.