Changeset 47b7006 in mainline for uspace/lib/c/arch


Ignore:
Timestamp:
2011-01-29T23:02:39Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
197ef43
Parents:
fd483ce
Message:

improve run-time termination

  • get rid of exit()
  • get rid of _exit(), use the common exit()
  • get rid of core(), use the common abort()
  • make main() more fail-safe (call abort() on unhealthy conditions), call async_sess_init() explicitly
  • add several libc-private headers for cleaner environment
  • use SYS_TASK_EXIT in exit() and abort()
Location:
uspace/lib/c/arch
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/abs32le/src/entry.c

    rfd483ce r47b7006  
    3737{
    3838        __main(NULL);
    39         __exit();
    4039}
    4140
  • uspace/lib/c/arch/abs32le/src/thread_entry.c

    rfd483ce r47b7006  
    3030 */
    3131
    32 #include <unistd.h>
    33 #include <thread.h>
    34 
    3532void __thread_entry(void)
    3633{
  • uspace/lib/c/arch/amd64/src/entry.s

    rfd483ce r47b7006  
    4747        # Pass PCB pointer to __main (no operation)
    4848        call __main
    49 
    50         call __exit
  • uspace/lib/c/arch/arm32/src/entry.s

    rfd483ce r47b7006  
    4242        ldr r0, =ras_page
    4343        str r2, [r0]
    44 
     44       
    4545        #
    4646        # Create the first stack frame.
     
    5050        push {fp, ip, lr, pc}
    5151        sub fp, ip, #4
    52 
     52       
    5353        # Pass pcb_ptr to __main as the first argument (in r0)
    5454        mov r0, r1
    5555        bl __main
    56 
    57         bl __exit
    5856
    5957.data
     
    6260ras_page:
    6361        .long 0
    64 
  • uspace/lib/c/arch/ia32/src/entry.s

    rfd483ce r47b7006  
    4646        mov %ax, %fs
    4747        # Do not set %gs, it contains descriptor that can see TLS
    48 
     48       
    4949        # Detect the mechanism used for making syscalls
    5050        movl $(INTEL_CPUID_STANDARD), %eax
     
    5858        # Create the first stack frame.
    5959        #
    60         pushl $0 
     60        pushl $0
    6161        movl %esp, %ebp
    62 
     62       
    6363        # Pass the PCB pointer to __main as the first argument
    6464        pushl %edi
    6565        call __main
    66 
    67         call __exit
  • uspace/lib/c/arch/ia64/src/entry.s

    rfd483ce r47b7006  
    4040        alloc loc0 = ar.pfs, 0, 1, 2, 0
    4141        movl gp = _gp
    42 
     42       
    4343        # Pass PCB pointer as the first argument to __main
    4444        mov out0 = r2
    4545        br.call.sptk.many b0 = __main
    46 0:
    47         br.call.sptk.many b0 = __exit
  • uspace/lib/c/arch/mips32/src/entry.s

    rfd483ce r47b7006  
    5656        jal __main
    5757        nop
    58        
    59         jal __exit
    60         nop
    6158.end
    6259
  • uspace/lib/c/arch/ppc32/src/entry.s

    rfd483ce r47b7006  
    4444        stw %r3, 0(%r1)
    4545        stwu %r1, -16(%r1)
    46 
     46       
    4747        # Pass the PCB pointer to __main() as the first argument.
    4848        # The first argument is passed in r3.
    4949        mr %r3, %r6
    5050        bl __main
    51 
    52         bl __exit
  • uspace/lib/c/arch/sparc64/src/entry.s

    rfd483ce r47b7006  
    4545        flushw
    4646        add %g0, -0x7ff, %fp
    47 
     47       
    4848        # Pass pcb_ptr as the first argument to __main()
    4949        mov %i1, %o0
     
    5151        call __main
    5252        or %l7, %lo(_gp), %l7
    53 
    54         call __exit
    55         nop
Note: See TracChangeset for help on using the changeset viewer.