Changeset 25f9823 in mainline


Ignore:
Timestamp:
2006-05-17T21:52:56Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b399cc
Parents:
04552a80
Message:

create special entry point for drivers (don't initialize I/O)

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • fb/Makefile

    r04552a80 r25f9823  
    6161
    6262$(OUTPUT): $(OBJECTS) $(LIBS)
    63         $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     63        $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    6464
    6565disasm:
  • kbd/Makefile

    r04552a80 r25f9823  
    6868
    6969$(OUTPUT): $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(LIBS)
    70         $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     70        $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(GENERIC_OBJECTS) $(ARCH_OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    7171
    7272disasm:
  • libc/arch/amd64/src/entry.s

    r04552a80 r25f9823  
    3232
    3333.globl __entry
     34.globl __entry_driver
    3435
    3536## User-space task entry point
     
    3839__entry:
    3940        call __main
     41        call __io_init
    4042        call main
    4143        call __exit
    42        
    43 .end __entry
     44
     45__entry_driver:
     46        call __main
     47        call main
     48        call __exit
  • libc/arch/ia32/src/entry.s

    r04552a80 r25f9823  
    3232
    3333.globl __entry
     34.globl __entry_driver
    3435
    3536## User-space task entry point
     
    4344        # Do not set %gs, it contains descriptor that can see TLS
    4445       
    45         call __main     
     46        call __main
     47        call __io_init
    4648        call main
    4749        call __exit
    4850       
    49 .end __entry
     51__entry_driver:
     52        mov %ss, %ax
     53        mov %ax, %ds
     54        mov %ax, %es
     55        mov %ax, %fs
     56        # Do not set %gs, it contains descriptor that can see TLS
     57       
     58        call __main
     59        call main
     60        call __exit
  • libc/arch/ia64/src/entry.s

    r04552a80 r25f9823  
    3232
    3333.globl __entry
     34.globl __entry_driver
    3435
    3536## User-space task entry point
     
    4041        mov r1 = _gp
    4142        { br.call.sptk.many b0 = __main }
     43        { br.call.sptk.many b0 = __io_init }
    4244        { br.call.sptk.many b0 = main }
    4345        { br.call.sptk.many b0 = __exit }
    44        
    45 .end __entry
     46
     47__entry_driver:
     48        alloc loc0 = ar.pfs, 0, 1, 2, 0
     49        mov r1 = _gp
     50        { br.call.sptk.many b0 = __main }
     51        { br.call.sptk.many b0 = main }
     52        { br.call.sptk.many b0 = __exit }
  • libc/arch/mips32/_link.ld.in

    r04552a80 r25f9823  
    11STARTUP(../libc/arch/ARCH/src/entry.o)
    2 ENTRY(__start)
     2ENTRY(__entry)
    33
    44PHDRS {
  • libc/arch/mips32/src/entry.s

    r04552a80 r25f9823  
    2929.text
    3030.section .init, "ax"
    31 .global __start
     31.global __entry
     32.global __entry_driver
    3233.set noreorder
    3334.option pic2
     
    3637#
    3738#
    38 .ent __start
    39 __start:
     39.ent __entry
     40__entry:
     41        .frame $sp, 32, $31
     42        .cpload $25
     43       
     44       
     45        # Mips o32 may store its arguments on stack, make space (16 bytes),
     46        # so that it could work with -O0
     47        # Make space additional 16 bytes for the stack frame
     48
     49        addiu $sp, -32
     50        .cprestore 16   # Allow PIC code
     51       
     52        jal __main
     53        nop
     54       
     55        jal __io_init
     56        nop
     57       
     58        jal main
     59        nop
     60       
     61        jal __exit
     62        nop
     63
     64.ent __entry_driver
     65__entry_driver:
    4066        .frame $sp, 32, $31
    4167        .cpload $25
     
    5783        jal __exit
    5884        nop
    59        
    60 .end __start
    6185
    6286# Alignment of output section data to 0x4000
  • libc/arch/ppc32/src/entry.s

    r04552a80 r25f9823  
    3232
    3333.globl __entry
     34.globl __entry_driver
    3435
    3536## User-space task entry point
     
    3738#
    3839__entry:
    39         bl __main       
     40        bl __main
     41        bl __io_init
    4042        bl main
    4143        bl __exit
    42        
    43 .end __entry
     44
     45__entry_driver:
     46        bl __main
     47        bl main
     48        bl __exit
  • libc/generic/libc.c

    r04552a80 r25f9823  
    4646        psthread_setup(tcb);
    4747        _ipc_init();
    48        
     48}
     49
     50void __io_init(void) {
    4951        open("stdin", 0);
    5052        open("stdout", 0);
  • ns/Makefile

    r04552a80 r25f9823  
    5959
    6060$(OUTPUT): $(OBJECTS) $(LIBS)
    61         $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     61        $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld -e __entry_driver $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    6262
    6363disasm:
  • pci/Makefile

    r04552a80 r25f9823  
    6161$(OUTPUT): $(OBJECTS) $(LIBS)
    6262        $(MAKE) -C libpci
    63         $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld  $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
     63        $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
    6464
    6565disasm:
Note: See TracChangeset for help on using the changeset viewer.