Changes in / [f9c3ef44:7df0c2ff] in mainline
- Files:
-
- 1 added
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ia64/Makefile.inc
rf9c3ef44 r7df0c2ff 31 31 BFD_ARCH = ia64 32 32 33 #34 # FIXME:35 #36 # The -fno-selective-scheduling and -fno-selective-scheduling2 options37 # should be removed as soon as a bug in GCC concerning unchecked38 # speculative loads is fixed.39 #40 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53975 for reference.41 #42 43 33 BITS = 64 44 34 ENDIANESS = LE 45 EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata -fno-selective-scheduling -fno-selective-scheduling235 EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata 46 36 47 37 RD_SRVS_NON_ESSENTIAL += -
kernel/arch/amd64/src/asm.S
rf9c3ef44 r7df0c2ff 362 362 */ 363 363 call syscall_handler 364 365 /* 366 * Test if the saved return address is canonical and not-kernel. 367 * We do this by looking at the 16 most significant bits 368 * of the saved return address (two bytes at offset 6). 369 */ 370 testw $0xffff, ISTATE_OFFSET_RIP+6(%rsp) 371 jnz bad_rip 372 364 373 365 cli 374 366 … … 396 388 sysretq 397 389 398 bad_rip:399 movq %rsp, %rdi400 movabs $bad_rip_msg, %rsi401 xorb %al, %al402 callq fault_from_uspace403 /* not reached */404 405 bad_rip_msg:406 .asciz "Invalid instruction pointer."407 408 390 /** Print Unicode character to EGA display. 409 391 * -
kernel/arch/amd64/src/boot/multiboot.S
rf9c3ef44 r7df0c2ff 76 76 77 77 multiboot_image_start: 78 cli79 78 cld 80 79 … … 82 81 movl $START_STACK, %esp 83 82 84 /* 85 * Initialize Global Descriptor Table and 86 * Interrupt Descriptor Table registers 87 */ 83 /* Initialize Global Descriptor Table register */ 88 84 lgdtl bootstrap_gdtr 89 lidtl bootstrap_idtr90 85 91 86 /* Kernel data + stack */ … … 650 645 .section K_DATA_START, "aw", @progbits 651 646 652 .global bootstrap_idtr653 bootstrap_idtr:654 .word 0655 .long 0656 657 647 .global bootstrap_gdtr 658 648 bootstrap_gdtr: -
kernel/arch/amd64/src/boot/multiboot2.S
rf9c3ef44 r7df0c2ff 116 116 117 117 multiboot2_image_start: 118 cli119 118 cld 120 119 … … 122 121 movl $START_STACK, %esp 123 122 124 /* 125 * Initialize Global Descriptor Table and 126 * Interrupt Descriptor Table registers 127 */ 123 /* Initialize Global Descriptor Table register */ 128 124 lgdtl bootstrap_gdtr 129 lidtl bootstrap_idtr130 125 131 126 /* Kernel data + stack */ -
kernel/arch/amd64/src/boot/vesa_ret.inc
rf9c3ef44 r7df0c2ff 1 1 .code32 2 2 vesa_init_protected: 3 cli4 3 cld 5 4 -
kernel/arch/ia32/src/boot/multiboot.S
rf9c3ef44 r7df0c2ff 73 73 74 74 multiboot_image_start: 75 cli76 75 cld 77 76 … … 79 78 movl $START_STACK, %esp 80 79 81 /* 82 * Initialize Global Descriptor Table and 83 * Interrupt Descriptor Table registers 84 */ 80 /* Initialize Global Descriptor Table register */ 85 81 lgdtl bootstrap_gdtr 86 lidtl bootstrap_idtr87 82 88 83 /* Kernel data + stack */ … … 706 701 page_directory: 707 702 .space 4096, 0 708 709 .global bootstrap_idtr710 bootstrap_idtr:711 .word 0712 .long 0713 703 714 704 .global bootstrap_gdtr -
kernel/arch/ia32/src/boot/multiboot2.S
rf9c3ef44 r7df0c2ff 114 114 115 115 multiboot2_image_start: 116 cli117 116 cld 118 117 … … 120 119 movl $START_STACK, %esp 121 120 122 /* 123 * Initialize Global Descriptor Table and 124 * Interrupt Descriptor Table registers 125 */ 121 /* Initialize Global Descriptor Table register */ 126 122 lgdtl bootstrap_gdtr 127 lidtl bootstrap_idtr128 123 129 124 /* Kernel data + stack */ -
kernel/arch/ia32/src/boot/vesa_prot.inc
rf9c3ef44 r7df0c2ff 88 88 /* Returned back to protected mode */ 89 89 90 /*91 * Initialize Global Descriptor Table and92 * Interrupt Descriptor Table registers93 */94 lgdtl bootstrap_gdtr95 lidtl bootstrap_idtr96 97 90 movzx %ax, %ecx 98 91 mov %ecx, KA2PA(bfb_scanline) -
kernel/arch/ia32/src/boot/vesa_real.inc
rf9c3ef44 r7df0c2ff 30 30 .code32 31 31 vesa_init: 32 lidtl vesa_idtr33 32 jmp $GDT_SELECTOR(VESA_INIT_DES), $vesa_init_real - vesa_init 34 35 vesa_idtr:36 .word 0x3ff37 .long 038 33 39 34 .code16 -
kernel/arch/ia32/src/boot/vesa_ret.inc
rf9c3ef44 r7df0c2ff 1 1 .code32 2 2 vesa_init_protected: 3 cli4 3 cld 5 4 -
kernel/arch/ia64/Makefile.inc
rf9c3ef44 r7df0c2ff 30 30 BFD_ARCH = ia64-elf64 31 31 32 # 33 # FIXME: 34 # 35 # The -fno-selective-scheduling and -fno-selective-scheduling2 options 36 # should be removed as soon as a bug in GCC concerning unchecked 37 # speculative loads is fixed. 38 # 39 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53975 for reference. 40 # 41 42 CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127 -fno-selective-scheduling -fno-selective-scheduling2 32 CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127 43 33 GCC_CFLAGS += $(CMN1) 44 34 ICC_CFLAGS += $(CMN1) -
kernel/generic/include/interrupt.h
rf9c3ef44 r7df0c2ff 38 38 #include <arch/interrupt.h> 39 39 #include <print.h> 40 #include <stdarg.h>41 40 #include <typedefs.h> 42 41 #include <proc/task.h> … … 59 58 extern exc_table_t exc_table[]; 60 59 61 extern void fault_from_uspace(istate_t *, const char *, ...);62 60 extern void fault_if_from_uspace(istate_t *, const char *, ...) 63 61 PRINTF_ATTRIBUTE(2, 3); -
kernel/generic/src/interrupt/interrupt.c
rf9c3ef44 r7df0c2ff 50 50 #include <panic.h> 51 51 #include <print.h> 52 #include <stdarg.h>53 52 #include <symtab.h> 54 53 #include <proc/thread.h> … … 166 165 } 167 166 168 static NO_TRACE void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 169 { 167 /** Terminate thread and task if exception came from userspace. 168 * 169 */ 170 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 171 { 172 if (!istate_from_uspace(istate)) 173 return; 174 170 175 printf("Task %s (%" PRIu64 ") killed due to an exception at " 171 176 "program counter %p.\n", TASK->name, TASK->taskid, … … 176 181 177 182 printf("Kill message: "); 178 vprintf(fmt, args);179 printf("\n");180 181 task_kill_self(true);182 }183 184 /** Terminate thread and task after the exception came from userspace.185 *186 */187 NO_TRACE void fault_from_uspace(istate_t *istate, const char *fmt, ...)188 {189 va_list args;190 191 va_start(args, fmt);192 fault_from_uspace_core(istate, fmt, args);193 va_end(args);194 }195 196 /** Terminate thread and task if exception came from userspace.197 *198 */199 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)200 {201 if (!istate_from_uspace(istate))202 return;203 183 204 184 va_list args; 205 185 va_start(args, fmt); 206 fault_from_uspace_core(istate,fmt, args);186 vprintf(fmt, args); 207 187 va_end(args); 188 printf("\n"); 189 190 task_kill_self(true); 208 191 } 209 192 -
uspace/lib/c/arch/ia64/Makefile.common
rf9c3ef44 r7df0c2ff 27 27 # 28 28 29 # 30 # FIXME: 31 # 32 # The -fno-selective-scheduling and -fno-selective-scheduling2 options 33 # should be removed as soon as a bug in GCC concerning unchecked 34 # speculative loads is fixed. 35 # 36 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53975 for reference. 37 # 38 39 GCC_CFLAGS += -fno-unwind-tables -fno-selective-scheduling -fno-selective-scheduling2 29 GCC_CFLAGS += -fno-unwind-tables 40 30 41 31 ENDIANESS = LE -
uspace/lib/c/generic/malloc.c
rf9c3ef44 r7df0c2ff 110 110 111 111 #define AREA_LAST_BLOCK_HEAD(area) \ 112 ((uintptr_t) BLOCK_HEAD(((heap_block_foot_t *) 112 ((uintptr_t) BLOCK_HEAD(((heap_block_foot_t *)AREA_LAST_BLOCK_FOOT(area)))) 113 113 114 114 /** Get header in heap block. … … 349 349 return false; 350 350 351 heap_block_head_t *last_head = 352 (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 351 heap_block_head_t *last_head = (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 353 352 354 353 if (last_head->free) { … … 652 651 653 652 /** Try to enlarge any of the heap areas. 654 * 655 * If successful, allocate block of the given size in the area.653 * If successful, allocate block of the given size in the area. 654 * 656 655 * Should be called only inside the critical section. 657 656 * 658 * @param size 657 * @param size Gross size of item to allocate (bytes). 659 658 * @param align Memory address alignment. 660 *661 * @return Allocated block.662 * @return NULL on failure.663 659 * 664 660 */ … … 667 663 if (size == 0) 668 664 return NULL; 669 665 670 666 /* First try to enlarge some existing area */ 671 667 for (heap_area_t *area = first_heap_area; area != NULL; 672 668 area = area->next) { 673 669 674 670 if (area_grow(area, size + align)) { 675 heap_block_head_t *first = 676 (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 677 678 void *addr = 679 malloc_area(area, first, NULL, size, align); 671 heap_block_head_t *first = (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 672 673 void *addr = malloc_area(area, first, NULL, size, align); 680 674 malloc_assert(addr != NULL); 681 675 return addr; … … 685 679 /* Eventually try to create a new area */ 686 680 if (area_create(AREA_OVERHEAD(size + align))) { 687 heap_block_head_t *first = 688 (heap_block_head_t *) AREA_FIRST_BLOCK_HEAD(last_heap_area); 689 690 void *addr = 691 malloc_area(last_heap_area, first, NULL, size, align); 681 heap_block_head_t *first = (heap_block_head_t *) AREA_FIRST_BLOCK_HEAD(last_heap_area); 682 683 void *addr = malloc_area(last_heap_area, first, NULL, size, align); 692 684 malloc_assert(addr != NULL); 693 685 return addr; … … 715 707 716 708 size_t falign = lcm(align, BASE_ALIGN); 717 709 718 710 /* Check for integer overflow. */ 719 711 if (falign < align) 720 712 return NULL; 721 722 /* 723 * The size of the allocated block needs to be naturally 724 * aligned, because the footer structure also needs to reside 725 * on a naturally aligned address in order to avoid unaligned 726 * memory accesses. 727 */ 728 size_t gross_size = GROSS_SIZE(ALIGN_UP(size, BASE_ALIGN)); 713 714 size_t gross_size = GROSS_SIZE(size); 715 716 heap_block_head_t *split; 729 717 730 718 /* Try the next fit approach */ 731 heap_block_head_t *split = next_fit;719 split = next_fit; 732 720 733 721 if (split != NULL) { … … 766 754 void *calloc(const size_t nmemb, const size_t size) 767 755 { 768 // FIXME: Check for overflow769 770 756 void *block = malloc(nmemb * size); 771 757 if (block == NULL) … … 907 893 if (addr == NULL) 908 894 return; 909 895 910 896 futex_down(&malloc_futex); 911 897 -
uspace/srv/loader/Makefile
rf9c3ef44 r7df0c2ff 44 44 GENERIC_SOURCES = \ 45 45 main.c \ 46 interp. S46 interp.s 47 47 48 48 SOURCES = \
Note:
See TracChangeset
for help on using the changeset viewer.