Changeset f9c3ef44 in mainline
- Timestamp:
- 2012-07-28T09:01:24Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8847142
- Parents:
- 7df0c2ff (diff), b2ba418 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 16 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ia64/Makefile.inc
r7df0c2ff rf9c3ef44 31 31 BFD_ARCH = ia64 32 32 33 # 34 # FIXME: 35 # 36 # The -fno-selective-scheduling and -fno-selective-scheduling2 options 37 # should be removed as soon as a bug in GCC concerning unchecked 38 # speculative loads is fixed. 39 # 40 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53975 for reference. 41 # 42 33 43 BITS = 64 34 44 ENDIANESS = LE 35 EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata 45 EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata -fno-selective-scheduling -fno-selective-scheduling2 36 46 37 47 RD_SRVS_NON_ESSENTIAL += -
kernel/arch/amd64/src/asm.S
r7df0c2ff rf9c3ef44 362 362 */ 363 363 call syscall_handler 364 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 365 373 cli 366 374 … … 388 396 sysretq 389 397 398 bad_rip: 399 movq %rsp, %rdi 400 movabs $bad_rip_msg, %rsi 401 xorb %al, %al 402 callq fault_from_uspace 403 /* not reached */ 404 405 bad_rip_msg: 406 .asciz "Invalid instruction pointer." 407 390 408 /** Print Unicode character to EGA display. 391 409 * -
kernel/arch/amd64/src/boot/multiboot.S
r7df0c2ff rf9c3ef44 76 76 77 77 multiboot_image_start: 78 cli 78 79 cld 79 80 … … 81 82 movl $START_STACK, %esp 82 83 83 /* Initialize Global Descriptor Table register */ 84 /* 85 * Initialize Global Descriptor Table and 86 * Interrupt Descriptor Table registers 87 */ 84 88 lgdtl bootstrap_gdtr 89 lidtl bootstrap_idtr 85 90 86 91 /* Kernel data + stack */ … … 645 650 .section K_DATA_START, "aw", @progbits 646 651 652 .global bootstrap_idtr 653 bootstrap_idtr: 654 .word 0 655 .long 0 656 647 657 .global bootstrap_gdtr 648 658 bootstrap_gdtr: -
kernel/arch/amd64/src/boot/multiboot2.S
r7df0c2ff rf9c3ef44 116 116 117 117 multiboot2_image_start: 118 cli 118 119 cld 119 120 … … 121 122 movl $START_STACK, %esp 122 123 123 /* Initialize Global Descriptor Table register */ 124 /* 125 * Initialize Global Descriptor Table and 126 * Interrupt Descriptor Table registers 127 */ 124 128 lgdtl bootstrap_gdtr 129 lidtl bootstrap_idtr 125 130 126 131 /* Kernel data + stack */ -
kernel/arch/amd64/src/boot/vesa_ret.inc
r7df0c2ff rf9c3ef44 1 1 .code32 2 2 vesa_init_protected: 3 cli 3 4 cld 4 5 -
kernel/arch/ia32/src/boot/multiboot.S
r7df0c2ff rf9c3ef44 73 73 74 74 multiboot_image_start: 75 cli 75 76 cld 76 77 … … 78 79 movl $START_STACK, %esp 79 80 80 /* Initialize Global Descriptor Table register */ 81 /* 82 * Initialize Global Descriptor Table and 83 * Interrupt Descriptor Table registers 84 */ 81 85 lgdtl bootstrap_gdtr 86 lidtl bootstrap_idtr 82 87 83 88 /* Kernel data + stack */ … … 701 706 page_directory: 702 707 .space 4096, 0 708 709 .global bootstrap_idtr 710 bootstrap_idtr: 711 .word 0 712 .long 0 703 713 704 714 .global bootstrap_gdtr -
kernel/arch/ia32/src/boot/multiboot2.S
r7df0c2ff rf9c3ef44 114 114 115 115 multiboot2_image_start: 116 cli 116 117 cld 117 118 … … 119 120 movl $START_STACK, %esp 120 121 121 /* Initialize Global Descriptor Table register */ 122 /* 123 * Initialize Global Descriptor Table and 124 * Interrupt Descriptor Table registers 125 */ 122 126 lgdtl bootstrap_gdtr 127 lidtl bootstrap_idtr 123 128 124 129 /* Kernel data + stack */ -
kernel/arch/ia32/src/boot/vesa_prot.inc
r7df0c2ff rf9c3ef44 88 88 /* Returned back to protected mode */ 89 89 90 /* 91 * Initialize Global Descriptor Table and 92 * Interrupt Descriptor Table registers 93 */ 94 lgdtl bootstrap_gdtr 95 lidtl bootstrap_idtr 96 90 97 movzx %ax, %ecx 91 98 mov %ecx, KA2PA(bfb_scanline) -
kernel/arch/ia32/src/boot/vesa_real.inc
r7df0c2ff rf9c3ef44 30 30 .code32 31 31 vesa_init: 32 lidtl vesa_idtr 32 33 jmp $GDT_SELECTOR(VESA_INIT_DES), $vesa_init_real - vesa_init 34 35 vesa_idtr: 36 .word 0x3ff 37 .long 0 33 38 34 39 .code16 -
kernel/arch/ia32/src/boot/vesa_ret.inc
r7df0c2ff rf9c3ef44 1 1 .code32 2 2 vesa_init_protected: 3 cli 3 4 cld 4 5 -
kernel/arch/ia64/Makefile.inc
r7df0c2ff rf9c3ef44 30 30 BFD_ARCH = ia64-elf64 31 31 32 CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127 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 33 43 GCC_CFLAGS += $(CMN1) 34 44 ICC_CFLAGS += $(CMN1) -
kernel/generic/include/interrupt.h
r7df0c2ff rf9c3ef44 38 38 #include <arch/interrupt.h> 39 39 #include <print.h> 40 #include <stdarg.h> 40 41 #include <typedefs.h> 41 42 #include <proc/task.h> … … 58 59 extern exc_table_t exc_table[]; 59 60 61 extern void fault_from_uspace(istate_t *, const char *, ...); 60 62 extern void fault_if_from_uspace(istate_t *, const char *, ...) 61 63 PRINTF_ATTRIBUTE(2, 3); -
kernel/generic/src/interrupt/interrupt.c
r7df0c2ff rf9c3ef44 50 50 #include <panic.h> 51 51 #include <print.h> 52 #include <stdarg.h> 52 53 #include <symtab.h> 53 54 #include <proc/thread.h> … … 165 166 } 166 167 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 168 static NO_TRACE void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 169 { 175 170 printf("Task %s (%" PRIu64 ") killed due to an exception at " 176 171 "program counter %p.\n", TASK->name, TASK->taskid, … … 181 176 182 177 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; 183 203 184 204 va_list args; 185 205 va_start(args, fmt); 186 vprintf(fmt, args);206 fault_from_uspace_core(istate, fmt, args); 187 207 va_end(args); 188 printf("\n");189 190 task_kill_self(true);191 208 } 192 209 -
uspace/lib/c/arch/ia64/Makefile.common
r7df0c2ff rf9c3ef44 27 27 # 28 28 29 GCC_CFLAGS += -fno-unwind-tables 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 30 40 31 41 ENDIANESS = LE -
uspace/lib/c/generic/malloc.c
r7df0c2ff rf9c3ef44 110 110 111 111 #define AREA_LAST_BLOCK_HEAD(area) \ 112 ((uintptr_t) BLOCK_HEAD(((heap_block_foot_t *) AREA_LAST_BLOCK_FOOT(area))))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 = (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 351 heap_block_head_t *last_head = 352 (heap_block_head_t *) AREA_LAST_BLOCK_HEAD(area); 352 353 353 354 if (last_head->free) { … … 651 652 652 653 /** Try to enlarge any of the heap areas. 653 * If successful, allocate block of the given size in the area.654 * 654 * 655 * If successful, allocate block of the given size in the area. 655 656 * Should be called only inside the critical section. 656 657 * 657 * @param size Gross size of item to allocate (bytes).658 * @param size Gross size of item to allocate (bytes). 658 659 * @param align Memory address alignment. 660 * 661 * @return Allocated block. 662 * @return NULL on failure. 659 663 * 660 664 */ … … 663 667 if (size == 0) 664 668 return NULL; 665 669 666 670 /* First try to enlarge some existing area */ 667 671 for (heap_area_t *area = first_heap_area; area != NULL; 668 672 area = area->next) { 669 673 670 674 if (area_grow(area, 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); 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); 674 680 malloc_assert(addr != NULL); 675 681 return addr; … … 679 685 /* Eventually try to create a new area */ 680 686 if (area_create(AREA_OVERHEAD(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); 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); 684 692 malloc_assert(addr != NULL); 685 693 return addr; … … 707 715 708 716 size_t falign = lcm(align, BASE_ALIGN); 709 717 710 718 /* Check for integer overflow. */ 711 719 if (falign < align) 712 720 return NULL; 713 714 size_t gross_size = GROSS_SIZE(size); 715 716 heap_block_head_t *split; 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)); 717 729 718 730 /* Try the next fit approach */ 719 split = next_fit;731 heap_block_head_t *split = next_fit; 720 732 721 733 if (split != NULL) { … … 754 766 void *calloc(const size_t nmemb, const size_t size) 755 767 { 768 // FIXME: Check for overflow 769 756 770 void *block = malloc(nmemb * size); 757 771 if (block == NULL) … … 893 907 if (addr == NULL) 894 908 return; 895 909 896 910 futex_down(&malloc_futex); 897 911 -
uspace/srv/loader/Makefile
r7df0c2ff rf9c3ef44 44 44 GENERIC_SOURCES = \ 45 45 main.c \ 46 interp. s46 interp.S 47 47 48 48 SOURCES = \ -
uspace/srv/loader/interp.S
r7df0c2ff rf9c3ef44 4 4 # the program loader. 5 5 # 6 .section .interp , "" 6 7 #ifdef UARCH_arm32 8 #define AT_NOTE %note 9 #else 10 #define AT_NOTE @note 11 #endif 12 13 .section .interp, "a", AT_NOTE 7 14 .string "kernel"
Note:
See TracChangeset
for help on using the changeset viewer.