Changes in / [f9c3ef44:7df0c2ff] in mainline


Ignore:
Files:
1 added
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ia64/Makefile.inc

    rf9c3ef44 r7df0c2ff  
    3131BFD_ARCH = ia64
    3232
    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 
    4333BITS = 64
    4434ENDIANESS = LE
    45 EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata -fno-selective-scheduling -fno-selective-scheduling2
     35EXTRA_CFLAGS = -fno-unwind-tables -mfixed-range=f32-f127 -mno-pic -mno-sdata
    4636
    4737RD_SRVS_NON_ESSENTIAL +=
  • kernel/arch/amd64/src/asm.S

    rf9c3ef44 r7df0c2ff  
    362362         */
    363363        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       
    373365        cli
    374366       
     
    396388        sysretq
    397389
    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 
    408390/** Print Unicode character to EGA display.
    409391 *
  • kernel/arch/amd64/src/boot/multiboot.S

    rf9c3ef44 r7df0c2ff  
    7676
    7777multiboot_image_start:
    78         cli
    7978        cld
    8079       
     
    8281        movl $START_STACK, %esp
    8382       
    84         /*
    85          * Initialize Global Descriptor Table and
    86          * Interrupt Descriptor Table registers
    87          */
     83        /* Initialize Global Descriptor Table register */
    8884        lgdtl bootstrap_gdtr
    89         lidtl bootstrap_idtr
    9085       
    9186        /* Kernel data + stack */
     
    650645.section K_DATA_START, "aw", @progbits
    651646
    652 .global bootstrap_idtr
    653 bootstrap_idtr:
    654         .word 0
    655         .long 0
    656 
    657647.global bootstrap_gdtr
    658648bootstrap_gdtr:
  • kernel/arch/amd64/src/boot/multiboot2.S

    rf9c3ef44 r7df0c2ff  
    116116
    117117multiboot2_image_start:
    118         cli
    119118        cld
    120119       
     
    122121        movl $START_STACK, %esp
    123122       
    124         /*
    125          * Initialize Global Descriptor Table and
    126          * Interrupt Descriptor Table registers
    127          */
     123        /* Initialize Global Descriptor Table register */
    128124        lgdtl bootstrap_gdtr
    129         lidtl bootstrap_idtr
    130125       
    131126        /* Kernel data + stack */
  • kernel/arch/amd64/src/boot/vesa_ret.inc

    rf9c3ef44 r7df0c2ff  
    11.code32
    22vesa_init_protected:
    3         cli
    43        cld
    54       
  • kernel/arch/ia32/src/boot/multiboot.S

    rf9c3ef44 r7df0c2ff  
    7373
    7474multiboot_image_start:
    75         cli
    7675        cld
    7776       
     
    7978        movl $START_STACK, %esp
    8079       
    81         /*
    82          * Initialize Global Descriptor Table and
    83          * Interrupt Descriptor Table registers
    84          */
     80        /* Initialize Global Descriptor Table register */
    8581        lgdtl bootstrap_gdtr
    86         lidtl bootstrap_idtr
    8782       
    8883        /* Kernel data + stack */
     
    706701page_directory:
    707702        .space 4096, 0
    708 
    709 .global bootstrap_idtr
    710 bootstrap_idtr:
    711         .word 0
    712         .long 0
    713703
    714704.global bootstrap_gdtr
  • kernel/arch/ia32/src/boot/multiboot2.S

    rf9c3ef44 r7df0c2ff  
    114114
    115115multiboot2_image_start:
    116         cli
    117116        cld
    118117       
     
    120119        movl $START_STACK, %esp
    121120       
    122         /*
    123          * Initialize Global Descriptor Table and
    124          * Interrupt Descriptor Table registers
    125          */
     121        /* Initialize Global Descriptor Table register */
    126122        lgdtl bootstrap_gdtr
    127         lidtl bootstrap_idtr
    128123       
    129124        /* Kernel data + stack */
  • kernel/arch/ia32/src/boot/vesa_prot.inc

    rf9c3ef44 r7df0c2ff  
    8888                /* Returned back to protected mode */
    8989               
    90                 /*
    91                  * Initialize Global Descriptor Table and
    92                  * Interrupt Descriptor Table registers
    93                  */
    94                 lgdtl bootstrap_gdtr
    95                 lidtl bootstrap_idtr
    96                
    9790                movzx %ax, %ecx
    9891                mov %ecx, KA2PA(bfb_scanline)
  • kernel/arch/ia32/src/boot/vesa_real.inc

    rf9c3ef44 r7df0c2ff  
    3030.code32
    3131vesa_init:
    32         lidtl vesa_idtr
    3332        jmp $GDT_SELECTOR(VESA_INIT_DES), $vesa_init_real - vesa_init
    34 
    35 vesa_idtr:
    36         .word 0x3ff
    37         .long 0
    3833
    3934.code16
  • kernel/arch/ia32/src/boot/vesa_ret.inc

    rf9c3ef44 r7df0c2ff  
    11.code32
    22vesa_init_protected:
    3         cli
    43        cld
    54       
  • kernel/arch/ia64/Makefile.inc

    rf9c3ef44 r7df0c2ff  
    3030BFD_ARCH = ia64-elf64
    3131
    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
     32CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
    4333GCC_CFLAGS += $(CMN1)
    4434ICC_CFLAGS += $(CMN1)
  • kernel/generic/include/interrupt.h

    rf9c3ef44 r7df0c2ff  
    3838#include <arch/interrupt.h>
    3939#include <print.h>
    40 #include <stdarg.h>
    4140#include <typedefs.h>
    4241#include <proc/task.h>
     
    5958extern exc_table_t exc_table[];
    6059
    61 extern void fault_from_uspace(istate_t *, const char *, ...);
    6260extern void fault_if_from_uspace(istate_t *, const char *, ...)
    6361    PRINTF_ATTRIBUTE(2, 3);
  • kernel/generic/src/interrupt/interrupt.c

    rf9c3ef44 r7df0c2ff  
    5050#include <panic.h>
    5151#include <print.h>
    52 #include <stdarg.h>
    5352#include <symtab.h>
    5453#include <proc/thread.h>
     
    166165}
    167166
    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 */
     170NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...)
     171{
     172        if (!istate_from_uspace(istate))
     173                return;
     174       
    170175        printf("Task %s (%" PRIu64 ") killed due to an exception at "
    171176            "program counter %p.\n", TASK->name, TASK->taskid,
     
    176181       
    177182        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;
    203183       
    204184        va_list args;
    205185        va_start(args, fmt);
    206         fault_from_uspace_core(istate, fmt, args);
     186        vprintf(fmt, args);
    207187        va_end(args);
     188        printf("\n");
     189       
     190        task_kill_self(true);
    208191}
    209192
  • uspace/lib/c/arch/ia64/Makefile.common

    rf9c3ef44 r7df0c2ff  
    2727#
    2828
    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
     29GCC_CFLAGS += -fno-unwind-tables
    4030
    4131ENDIANESS = LE
  • uspace/lib/c/generic/malloc.c

    rf9c3ef44 r7df0c2ff  
    110110
    111111#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))))
    113113
    114114/** Get header in heap block.
     
    349349                return false;
    350350       
    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);
    353352       
    354353        if (last_head->free) {
     
    652651
    653652/** 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 *
    656655 * Should be called only inside the critical section.
    657656 *
    658  * @param size  Gross size of item to allocate (bytes).
     657 * @param size Gross size of item to allocate (bytes).
    659658 * @param align Memory address alignment.
    660  *
    661  * @return Allocated block.
    662  * @return NULL on failure.
    663659 *
    664660 */
     
    667663        if (size == 0)
    668664                return NULL;
    669        
     665               
    670666        /* First try to enlarge some existing area */
    671667        for (heap_area_t *area = first_heap_area; area != NULL;
    672668            area = area->next) {
    673                
     669           
    674670                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);
    680674                        malloc_assert(addr != NULL);
    681675                        return addr;
     
    685679        /* Eventually try to create a new area */
    686680        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);
    692684                malloc_assert(addr != NULL);
    693685                return addr;
     
    715707       
    716708        size_t falign = lcm(align, BASE_ALIGN);
    717        
     709
    718710        /* Check for integer overflow. */
    719711        if (falign < align)
    720712                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;
    729717       
    730718        /* Try the next fit approach */
    731         heap_block_head_t *split = next_fit;
     719        split = next_fit;
    732720       
    733721        if (split != NULL) {
     
    766754void *calloc(const size_t nmemb, const size_t size)
    767755{
    768         // FIXME: Check for overflow
    769        
    770756        void *block = malloc(nmemb * size);
    771757        if (block == NULL)
     
    907893        if (addr == NULL)
    908894                return;
    909        
     895
    910896        futex_down(&malloc_futex);
    911897       
  • uspace/srv/loader/Makefile

    rf9c3ef44 r7df0c2ff  
    4444GENERIC_SOURCES = \
    4545        main.c \
    46         interp.S
     46        interp.s
    4747
    4848SOURCES = \
Note: See TracChangeset for help on using the changeset viewer.