repo_id
stringlengths
5
115
size
int64
590
5.01M
file_path
stringlengths
4
212
content
stringlengths
590
5.01M
stsp/newlib-ia16
28,115
libgloss/m68k/fido-crt0.S
/** * fido-crt0.S -- Simple startup code * * Copyright (c) 1995, 1996, 1998 Cygnus Support * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. * * Copyright 2006 Innovasic Semiconductor, All Rights Reserved. * Part of the fido Realtime Support Library * * Description: * This routine performs initializations assuming a Fido * development board. In order, the following functions are performed: * * -- memory offset register initialization * -- chip select register initialization for external memory * -- SDRAM ctrl register initialization for external memory * -- in line test of external SRAM * -- sets user SP for MasterContext0 (main) * -- copies the bss section to RAM * -- transfers control to MasterContext0 (main) * */ #include "asm.h" #include "fido.h" .title "fido-crt0.S for Fido" /*----------------------------------------------------------------------------*/ //--------- 66 MHz values -------- // set up CS0 for flash #define CS0_CTRL_VAL 0x0000024A #define CS0_TIMING_VAL 0x01000000 // set up CS1 for SDRAM #define CS1_CTRL_VAL 0x0200030A /* selects SDRAM ctrl instead of CS1 */ #define CS1_TIMING_VAL 0x00000000 /* N/A for SDRAM operation */ #define SDRAM_TIMING_0_VAL 0x00022522 /* TRP=0x2, TRCD=0x2, TRF=0x5, TWR=0x5 TCL=0x5 */ #define SDRAM_TIMING_1_VAL 0x00120407 /* INI_PREC=0x1, INI_REFT=0x2, REF_INTV=0x407 */ #define SDRAM_CONFIG_0_VAL 0x00002113 /* MA2T=0, DDW=x16device=0x2, dsz=64MBit, mbw=16bit, bnksz=8Mbyte */ #define SDRAM_CONFIG_1_VAL 0x00000000 /* IPREC=0, IREF=0, ISMR=0, PWDN=0, SREF=0 */ #define SDRAM_EXT_BANK_1_VAL 0x00001020 /* SDRAM memory bank 0 at addr 0x0200_0000 */ // set up CS2 for SRAM #define CS2_CTRL_VAL 0x03000267 #define CS2_TIMING_VAL 0x08400000 /*----------------------------------------------------------------------------*/ #define EXT_SRAM_END_ADDR 0x30FFFFC /* 1 MB of ext. SRAM (2-512Kx8 chips) */ #define PERP_PWRUP_MASK 0x0000 /* turn on all peripherals */ /* * Define an empty environment. */ .data 2 .align 2 SYM (environ): .long 0 .align 2 .text 2 /* * These symbols are defined in C code, so they need to always be * named with SYM because of the difference between object file formats. */ /* These are defined in C code. */ /* .extern SYM (main) */ .extern SYM (exit) .extern SYM (hardware_init_hook) .extern SYM (software_init_hook) .extern SYM (atexit) .extern SYM (__do_global_dtors) /* * These values are set in the linker script, so they must be * explicitly named here without SYM. */ #ifdef FIDO_rom .extern __stack #endif .extern __bss_start .extern _end /* * set things up so application will run. This *must* be called _start. */ .global SYM (_start) SYM (_start): #ifdef FIDO_rom /* save initial value of base offset register */ movec mbb,d7 /* Initialize memory offset register to offset value in FIDOmemmap.h */ movel #FIDO_MEM_OFFSET,d0 /* Load memory offset into REG d0 */ movec d0,mbb movel #0x011, FIDO_DBG_CTRL /* set the debug control reg */ /* At POR the PerpPowerCtrlReg is set to 0x3F0F, all peripherals off See PerpPowerCtrlReg definition, this example turns ON everything */ movel #PERP_PWRUP_MASK,FIDO_CLOCK_MASK_REGISTER /* Set up chip selects for ROM, SRAM, and SDRAM (all external mem.) */ movel #CS0_CTRL_VAL, FIDO_BIU_CS0_CONTROL /* flash memory CS0 */ movel #CS0_TIMING_VAL, FIDO_BIU_CS0_TIMING movel #CS2_CTRL_VAL, FIDO_BIU_CS2_CONTROL /* SRAM memory CS2 */ movel #CS2_TIMING_VAL, FIDO_BIU_CS2_TIMING /* if this is not POR then say so */ movel FIDO_POR_REG,d6 /* test external SRAM -- */ /* a0 == working pointer */ /* a1 == pointer to base of memory */ /* a2 == pointer to end of memory */ /* d0,d1,d2,d3 working registers */ moveal #0x3000000,a1 moveal #0x30FFFFC,a2 movel a1,a0 /* walking ones */ movel #1,d0 .LWalkOnes: movel d0, (a0) /* write value out */ cmpl (a0), d0 /* read it back */ bne .LFailOnes lsl.l #1, d0 /* move to next value */ bne .LWalkOnes /* when it goes to zero you're done */ bra .LValTest .LFailOnes: movel #0x01, d0 bra .LMemTestEnd .LValTest: /* ffff's */ /* 5555's */ /* aaaa's */ /* 0000's */ movel a1,a0 movel #0xFFFFFFFF,d0 .LValLoop: movel d0,(a0) /* write value out */ cmpl (a0)+, d0 /* compare and move to next */ bne .LFailVal cmpl a0,a2 /* at end of memory? */ bge .LValLoop movel d0,d0 /* done writing zeros? */ beq .LAddrTest movel a1,a0 /* go back to start with next value */ subl #0x55555555,d0 /* get next value (f->a->5->0) */ bra .LValLoop .LFailVal: movel #0x02, d0 bra .LMemTestEnd .LAddrTest: /* unique values */ movel a1,a0 .LWriteLoop: movel a0, (a0)+ /* write value out and move one */ cmpl a0,a2 /* look for end of memory */ bge .LWriteLoop movel a1,a0 .LReadLoop: cmpl (a0), a0 /* compare value and move on */ bne .LFailAddr addql #4,a0 cmpl a0,a2 /* look for end of memory */ bge .LReadLoop clrl d0 /* everything passed */ bra .LMemTestEnd .LFailAddr: movel #0x03, d0 .LMemTestEnd: movel d0,d4 /* mem test result in d4 0 == pass */ #endif /* ROM */ /* See if user supplied their own stack (__stack != 0). If not, then * default to using the value of %sp as set by the ROM monitor */ movel IMM(__stack), a0 cmpl IMM(0), a0 jbeq .Lloc1 movel a0, sp .Lloc1: /* set up initial stack frame */ link a6, IMM(-8) #ifdef FIDO_rom /* * Now set up the SDRAM (waited to let the controller spin up) */ /* always initialize SDRAM regs, they're cleared by any reset */ /* SDRAM enbl bit set in CS1 re-directs to SDRAM controller regs */ movel #CS1_CTRL_VAL, FIDO_BIU_CS1_CONTROL /* SDRAM memory CS1 */ movel #SDRAM_TIMING_0_VAL, FIDO_SDRAM_TIMING_0 /* SDRAM TIMING REG0 */ movel #SDRAM_TIMING_1_VAL, FIDO_SDRAM_TIMING_1 /* SDRAM TIMING REG1 */ movel #SDRAM_CONFIG_0_VAL, FIDO_SDRAM_CONFIG_0 /* SDRAM CONFIG REG */ movel #0x0000001c, FIDO_SDRAM_CONFIG_1 /* SDRAM CONFIG REG */ .LsdConfigLoop: movel FIDO_SDRAM_CONFIG_1,d0 cmpl #0x00000000,d0 bne .LsdConfigLoop movel #SDRAM_EXT_BANK_1_VAL, FIDO_SDRAM_EXT_BANK_1 /* BANK 1 REG */ /* * copy data from ROM to RAM */ moval IMM(__start_romdata),a0 /* begin data in ROM */ moval IMM(_data), a1 /* begin data in RAM */ moval IMM(_edata),a2 /* end of data in RAM */ /* while(a1 < a2) *a1++ = *a0++; */ .LdataCopyLoop: movel (a0)+,(a1)+ cmpal a1,a2 bgt .LdataCopyLoop #endif /* ROM */ #ifdef FIDO_ram /* For ROM configs, the linker script ensures that _vector_table is placed at the proper place. For RAM configs, we have to adjust it ourselves. */ movel IMM (SYM (_vector_table)), FIDO_CTX0_VBR #endif #ifndef FIDO_redboot /* Setup interrupt vectors for secondary contexts. */ movel IMM (SYM (_vector_table1)), FIDO_CTX1_VBR movel IMM (SYM (_vector_table2)), FIDO_CTX2_VBR movel IMM (SYM (_vector_table3)), FIDO_CTX3_VBR movel IMM (SYM (_vector_table4)), FIDO_CTX4_VBR #endif /* * zero out the bss section. */ movel IMM(__bss_start), d1 movel IMM(_end), d0 cmpl d0, d1 jbeq .Lloc3 movl d1, a0 subl d1, d0 subql IMM(1), d0 2: clrb (a0)+ #ifndef __mcf5200__ dbra d0, 2b clrw d0 subql IMM(1), d0 jbcc 2b #else subql IMM(1), d0 jbpl 2b #endif .Lloc3: #ifdef ADD_DTORS /* put __do_global_dtors in the atexit list so the destructors get run */ movel IMM (SYM(__do_global_dtors)),(sp) jsr SYM (atexit) #endif movel IMM (_fini),(sp) jsr SYM (atexit) jsr _init /* * call the main routine from the application to get it going. * main (argc, argv, environ) * we pass argv as a pointer to NULL. */ pea 0 pea SYM (environ) pea sp@(4) pea 0 jsr SYM (main) /* call to main */ movel d0, sp@- /* * drop down into exit in case the user doesn't. This should drop * control back to the ROM monitor, if there is one. This calls the * exit() from the C library so the C++ tables get cleaned up right. */ jsr SYM (exit) #ifndef FIDO_redboot /* Define the interrupt vector table. The linker script ensures that the table is placed at address zero. */ .section .vector_table,"a" .global SYM (_vector_table) SYM (_vector_table): dc.l __stack /* 000 Initial Stack */ dc.l _start /* 001 Context 0 Start */ dc.l _BusErrorHandler /* 002 Bus Error */ dc.l _AddressErrorHandler /* 003 Address Error */ dc.l _IllegalInstructionHandler /* 004 Illegal Instruction */ dc.l _DivideByZeroHandler /* 005 Divide by Zero */ dc.l _ChkHandler /* 006 CHK, CHK2 Instructions */ dc.l _TrapccHandler /* 007 TRAPcc, TRAPV Instructions */ dc.l _PrivilegeViolationHandler /* 008 Privilege Violation */ dc.l _TraceHandler /* 009 Trace */ dc.l _ALineHandler /* 010 A-Line Unimplemented Instr */ dc.l _FLineHandler /* 011 F-Line Unimplemented Instr */ dc.l _HwBreakpointHandler /* 012 Hardware Breakpoint */ dc.l _Reserved0Handler /* 013 Reserved */ dc.l _FormatErrorHandler /* 014 Format Error */ dc.l _UnitializedIntHandler /* 015 Unitialized Interrupt */ dc.l _SoftwareIntHandler /* 016 Software Interrupt */ dc.l _Unassigned0Handler /* 017 Unassigned */ dc.l _Unassigned1Handler /* 018 Unassigned */ dc.l _Unassigned2Handler /* 019 Unassigned */ dc.l _Unassigned3Handler /* 020 Unassigned */ dc.l _Unassigned4Handler /* 021 Unassigned */ dc.l _Unassigned5Handler /* 022 Unassigned */ dc.l _Unassigned6Handler /* 023 Unassigned */ dc.l _Int0Handler /* 024 Interrupt 0 */ dc.l _Int1Handler /* 025 Interrupt 1 */ dc.l _Int2Handler /* 026 Interrupt 2 */ dc.l _Int3Handler /* 027 Interrupt 3 */ dc.l _Int4Handler /* 028 Interrupt 4 */ dc.l _Int5Handler /* 029 Interrupt 5 */ dc.l _Int6Handler /* 030 Interrupt 6 */ dc.l _Int7Handler /* 031 Interrupt 7 */ dc.l _Trap00Handler /* 032 Trap #00 Instruction */ dc.l _Trap01Handler /* 033 Trap #01 Instruction */ dc.l _Trap02Handler /* 034 Trap #02 Instruction */ dc.l _Trap03Handler /* 035 Trap #03 Instruction */ dc.l _Trap04Handler /* 036 Trap #04 Instruction */ dc.l _Trap05Handler /* 037 Trap #05 Instruction */ dc.l _Trap06Handler /* 038 Trap #06 Instruction */ dc.l _Trap07Handler /* 039 Trap #07 Instruction */ dc.l _Trap08Handler /* 040 Trap #08 Instruction */ dc.l _Trap09Handler /* 041 Trap #09 Instruction */ dc.l _Trap10Handler /* 042 Trap #10 Instruction */ dc.l _Trap11Handler /* 043 Trap #11 Instruction */ dc.l _Trap12Handler /* 044 Trap #12 Instruction */ dc.l _Trap13Handler /* 045 Trap #13 Instruction */ dc.l _Trap14Handler /* 046 Trap #14 Instruction */ dc.l _Trap15Handler /* 047 Trap #15 Instruction */ dc.l _Reserved048Handler /* 048 Reserved */ dc.l _Reserved049Handler /* 049 Reserved */ dc.l _Reserved050Handler /* 050 Reserved */ dc.l _Reserved051Handler /* 051 Reserved */ dc.l _Reserved052Handler /* 052 Reserved */ dc.l _Reserved053Handler /* 053 Reserved */ dc.l _Reserved054Handler /* 054 Reserved */ dc.l _Reserved055Handler /* 055 Reserved */ dc.l _Reserved056Handler /* 056 Reserved */ dc.l _Reserved057Handler /* 057 Reserved */ dc.l _Reserved058Handler /* 058 Reserved */ dc.l _Reserved059Handler /* 059 Reserved */ dc.l _Reserved060Handler /* 060 Reserved */ dc.l _Reserved061Handler /* 061 Reserved */ dc.l _Reserved062Handler /* 062 Reserved */ dc.l _Reserved063Handler /* 063 Reserved */ dc.l _ContextOvertimeHandler /* 064 Context Overtime */ dc.l _MpuErrorHandler /* 065 MPU Error */ dc.l _SystemTimer0Handler /* 066 System Timer 0 */ dc.l _SystemTimer1Handler /* 067 System Timer 1 */ dc.l _SystemTimer2Handler /* 068 System Timer 2 */ dc.l _SystemTimer3Handler /* 069 System Timer 3 */ dc.l _SystemTimer4Handler /* 070 System Timer 4 */ dc.l _WatchdogTimerHandler /* 071 Watchdog Timer */ dc.l _TimerCounter0Handler /* 072 Timer Counter 1 */ dc.l _TimerCounter1Handler /* 073 Timer Counter 2 */ dc.l _DMA0Handler /* 074 DMA Channel 0 */ dc.l _DMA1Handler /* 075 DMA Channel 1 */ dc.l _AtoDConversionHandler /* 076 A/D Conversion Complete */ dc.l _Pdma0Handler /* 077 PDMA Ch 0 Interrupt */ dc.l _Pdma1Handler /* 078 PDMA Ch 1 Interrupt */ dc.l _Pdma2Handler /* 079 PDMA Ch 2 Interrupt */ dc.l _Pdma3Handler /* 080 PDMA Ch 3 Interrupt */ dc.l _Reserved081Handler /* 081 Reserved */ dc.l _Reserved082Handler /* 082 Reserved */ dc.l _Reserved083Handler /* 083 Reserved */ dc.l _Reserved084Handler /* 084 Reserved */ dc.l _Reserved085Handler /* 085 Reserved */ dc.l _Reserved086Handler /* 086 Reserved */ dc.l _Reserved087Handler /* 087 Reserved */ dc.l _Reserved088Handler /* 088 Reserved */ dc.l _Reserved089Handler /* 089 Reserved */ dc.l _Reserved090Handler /* 090 Reserved */ dc.l _Reserved091Handler /* 091 Reserved */ dc.l _Reserved092Handler /* 092 Reserved */ dc.l _Reserved093Handler /* 093 Reserved */ dc.l _Reserved094Handler /* 094 Reserved */ dc.l _Reserved095Handler /* 095 Reserved */ dc.l _Trapx00Handler /* 096 Trapx 00 Instruction */ dc.l _Trapx01Handler /* 097 Trapx 01 Instruction */ dc.l _Trapx02Handler /* 098 Trapx 02 Instruction */ dc.l _Trapx03Handler /* 099 Trapx 03 Instruction */ dc.l _Trapx04Handler /* 100 Trapx 04 Instruction */ dc.l _Trapx05Handler /* 101 Trapx 05 Instruction */ dc.l _Trapx06Handler /* 102 Trapx 06 Instruction */ dc.l _Trapx07Handler /* 103 Trapx 07 Instruction */ dc.l _Trapx08Handler /* 104 Trapx 08 Instruction */ dc.l _Trapx09Handler /* 105 Trapx 09 Instruction */ dc.l _Trapx10Handler /* 106 Trapx 10 Instruction */ dc.l _Trapx11Handler /* 107 Trapx 11 Instruction */ dc.l _Trapx12Handler /* 108 Trapx 12 Instruction */ dc.l _Trapx13Handler /* 109 Trapx 13 Instruction */ dc.l _Trapx14Handler /* 110 Trapx 14 Instruction */ dc.l _Trapx15Handler /* 111 Trapx 15 Instruction */ dc.l _DummyHandler /* 112 */ dc.l _DummyHandler /* 113 */ dc.l _DummyHandler /* 114 */ dc.l _DummyHandler /* 115 */ dc.l _DummyHandler /* 116 */ dc.l _DummyHandler /* 117 */ dc.l _DummyHandler /* 118 */ dc.l _DummyHandler /* 119 */ dc.l _DummyHandler /* 120 */ dc.l _DummyHandler /* 121 */ dc.l _DummyHandler /* 122 */ dc.l _DummyHandler /* 123 */ dc.l _DummyHandler /* 124 */ dc.l _DummyHandler /* 125 */ dc.l _DummyHandler /* 126 */ dc.l _DummyHandler /* 127 */ dc.l _DummyHandler /* 128 */ dc.l _DummyHandler /* 129 */ dc.l _DummyHandler /* 130 */ dc.l _DummyHandler /* 131 */ dc.l _DummyHandler /* 132 */ dc.l _DummyHandler /* 133 */ dc.l _DummyHandler /* 134 */ dc.l _DummyHandler /* 135 */ dc.l _DummyHandler /* 136 */ dc.l _DummyHandler /* 137 */ dc.l _DummyHandler /* 138 */ dc.l _DummyHandler /* 139 */ dc.l _DummyHandler /* 140 */ dc.l _DummyHandler /* 141 */ dc.l _DummyHandler /* 142 */ dc.l _DummyHandler /* 143 */ dc.l _DummyHandler /* 144 */ dc.l _DummyHandler /* 145 */ dc.l _DummyHandler /* 146 */ dc.l _DummyHandler /* 147 */ dc.l _DummyHandler /* 148 */ dc.l _DummyHandler /* 149 */ dc.l _DummyHandler /* 150 */ dc.l _DummyHandler /* 151 */ dc.l _DummyHandler /* 152 */ dc.l _DummyHandler /* 153 */ dc.l _DummyHandler /* 154 */ dc.l _DummyHandler /* 155 */ dc.l _DummyHandler /* 156 */ dc.l _DummyHandler /* 157 */ dc.l _DummyHandler /* 158 */ dc.l _DummyHandler /* 159 */ dc.l _DummyHandler /* 160 */ dc.l _DummyHandler /* 161 */ dc.l _DummyHandler /* 162 */ dc.l _DummyHandler /* 163 */ dc.l _DummyHandler /* 164 */ dc.l _DummyHandler /* 165 */ dc.l _DummyHandler /* 166 */ dc.l _DummyHandler /* 167 */ dc.l _DummyHandler /* 168 */ dc.l _DummyHandler /* 169 */ dc.l _DummyHandler /* 170 */ dc.l _DummyHandler /* 171 */ dc.l _DummyHandler /* 172 */ dc.l _DummyHandler /* 173 */ dc.l _DummyHandler /* 174 */ dc.l _DummyHandler /* 175 */ dc.l _DummyHandler /* 176 */ dc.l _DummyHandler /* 177 */ dc.l _DummyHandler /* 178 */ dc.l _DummyHandler /* 179 */ dc.l _DummyHandler /* 180 */ dc.l _DummyHandler /* 181 */ dc.l _DummyHandler /* 182 */ dc.l _DummyHandler /* 183 */ dc.l _DummyHandler /* 184 */ dc.l _DummyHandler /* 185 */ dc.l _DummyHandler /* 186 */ dc.l _DummyHandler /* 187 */ dc.l _DummyHandler /* 188 */ dc.l _DummyHandler /* 189 */ dc.l _DummyHandler /* 190 */ dc.l _DummyHandler /* 191 */ dc.l _DummyHandler /* 192 */ dc.l _DummyHandler /* 193 */ dc.l _DummyHandler /* 194 */ dc.l _DummyHandler /* 195 */ dc.l _DummyHandler /* 196 */ dc.l _DummyHandler /* 197 */ dc.l _DummyHandler /* 198 */ dc.l _DummyHandler /* 199 */ dc.l _DummyHandler /* 200 */ dc.l _DummyHandler /* 201 */ dc.l _DummyHandler /* 202 */ dc.l _DummyHandler /* 203 */ dc.l _DummyHandler /* 204 */ dc.l _DummyHandler /* 205 */ dc.l _DummyHandler /* 206 */ dc.l _DummyHandler /* 207 */ dc.l _DummyHandler /* 208 */ dc.l _DummyHandler /* 209 */ dc.l _DummyHandler /* 210 */ dc.l _DummyHandler /* 211 */ dc.l _DummyHandler /* 212 */ dc.l _DummyHandler /* 213 */ dc.l _DummyHandler /* 214 */ dc.l _DummyHandler /* 215 */ dc.l _DummyHandler /* 216 */ dc.l _DummyHandler /* 217 */ dc.l _DummyHandler /* 218 */ dc.l _DummyHandler /* 219 */ dc.l _DummyHandler /* 220 */ dc.l _DummyHandler /* 221 */ dc.l _DummyHandler /* 222 */ dc.l _DummyHandler /* 223 */ dc.l _DummyHandler /* 224 */ dc.l _DummyHandler /* 225 */ dc.l _DummyHandler /* 226 */ dc.l _DummyHandler /* 227 */ dc.l _DummyHandler /* 228 */ dc.l _DummyHandler /* 229 */ dc.l _DummyHandler /* 230 */ dc.l _DummyHandler /* 231 */ dc.l _DummyHandler /* 232 */ dc.l _DummyHandler /* 233 */ dc.l _DummyHandler /* 234 */ dc.l _DummyHandler /* 235 */ dc.l _DummyHandler /* 236 */ dc.l _DummyHandler /* 237 */ dc.l _DummyHandler /* 238 */ dc.l _DummyHandler /* 239 */ dc.l _DummyHandler /* 240 */ dc.l _DummyHandler /* 241 */ dc.l _DummyHandler /* 242 */ dc.l _DummyHandler /* 243 */ dc.l _DummyHandler /* 244 */ dc.l _DummyHandler /* 245 */ dc.l _DummyHandler /* 246 */ dc.l _DummyHandler /* 247 */ dc.l _DummyHandler /* 248 */ dc.l _DummyHandler /* 249 */ dc.l _DummyHandler /* 250 */ dc.l _DummyHandler /* 251 */ dc.l _DummyHandler /* 252 */ dc.l _DummyHandler /* 253 */ dc.l _DummyHandler /* 254 */ dc.l _DummyHandler /* 255 */ /* * Define weak symbols for four alternate interrupt vectors. * These will be used as the interrupt vectors for the four * secondary contexts. */ .section .data .global SYM (_vector_table1) .weak SYM (_vector_table1) .set SYM (_vector_table1), SYM (_vector_table) .global SYM (_vector_table2) .weak SYM (_vector_table2) .set SYM (_vector_table2), SYM (_vector_table) .global SYM (_vector_table3) .weak SYM (_vector_table3) .set SYM (_vector_table3), SYM (_vector_table) .global SYM (_vector_table4) .weak SYM (_vector_table4) .set SYM (_vector_table4), SYM (_vector_table) #endif
stsp/newlib-ia16
3,367
libgloss/m68k/crt0.S
/* * crt0.S -- startup file for m68k-coff * * Copyright (c) 1995, 1996, 1998 Cygnus Support * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #include "asm.h" .title "crt0.S for m68k-coff" #define STACKSIZE 0x4000 /* * Define an empty environment. */ .data .align 2 SYM (environ): .long 0 .align 2 .text /* * These symbols are defined in C code, so they need to always be * named with SYM because of the difference between object file formats. */ /* These are defined in C code. */ .extern SYM (main) .extern SYM (exit) .extern SYM (hardware_init_hook) .extern SYM (software_init_hook) .extern SYM (atexit) .extern SYM(__do_global_dtors) /* * These values are set in the linker script, so they must be * explicitly named here without SYM. */ .extern __stack .extern __bss_start .extern _end /* * Set things up so the application will run. For historical reasons * this is called 'start'. We set things up to provide '_start' * as with other systems, but also provide a weak alias called * 'start' for compatibility with existing linker scripts. */ .global SYM (start) .weak SYM (start) .set SYM (start),SYM(_start) .global SYM (_start) SYM (_start): /* * put any hardware init code here */ /* See if user supplied their own stack (__stack != 0). If not, then * default to using the value of %sp as set by the ROM monitor. */ movel IMM(__stack), a0 cmpl IMM(0), a0 jbeq 1f movel a0, sp 1: /* set up initial stack frame */ link a6, IMM(-8) /* * zero out the bss section. */ movel IMM(__bss_start), d1 movel IMM(_end), d0 cmpl d0, d1 jbeq 3f movl d1, a0 subl d1, d0 subql IMM(1), d0 2: clrb (a0)+ #if !defined(__mcoldfire__) dbra d0, 2b clrw d0 subql IMM(1), d0 jbcc 2b #else subql IMM(1), d0 jbpl 2b #endif 3: /* * initialize target specific stuff. Only execute these * functions it they exist. */ PICLEA SYM (hardware_init_hook), a0 cmpl IMM(0),a0 jbeq 4f jsr (a0) 4: PICLEA SYM (software_init_hook), a0 cmpl IMM(0),a0 jbeq 5f jsr (a0) 5: /* * call the main routine from the application to get it going. * main (argc, argv, environ) * we pass argv as a pointer to NULL. */ #ifdef ADD_DTORS /* put __do_global_dtors in the atexit list so the destructors get run */ movel IMM (SYM(__do_global_dtors)),(sp) PICCALL SYM (atexit) #endif movel IMM (__FINI_SECTION__),(sp) PICCALL SYM (atexit) PICCALL __INIT_SECTION__ pea 0 PICPEA SYM (environ),a0 pea sp@(4) pea 0 PICCALL SYM (main) movel d0, sp@- /* * drop down into exit incase the user doesn't. This should drop * control back to the ROM monitor, if there is one. This calls the * exit() from the C library so the C++ tables get cleaned up right. */ PICCALL SYM (exit)
stsp/newlib-ia16
1,167
libgloss/m68k/cf-hosted.S
/* * cf-hosted.S -- * * Copyright (c) 2006 CodeSourcery Inc * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ /* Semihosting function. The debugger intercepts the halt, and determines that it is followed by the sentinel pattern. */ .globl __hosted __hosted: linkw %fp,#0 movel %fp@(8),%d0 movel %fp@(12),%d1 /* The semihosting sequence is 'nop; halt;sentinel' aligned to a 4 byte boundary. The sentinel is an ill formed instruction (movec %sp,0). The debugger will adjust the pc, so it is never executed. */ .balignw 4,0x4e71 nop halt .long 0x4e7bf000 unlk %fp rts
stsp/newlib-ia16
2,590
libgloss/m68k/cpu32bug.S
/* * cpu32bug.S -- board support for the CPU32BUG monitor. * * Copyright (c) 1995, 1996 Cygnus Support * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #include "asm.h" #include "cpu32bug.h" .title "cpu32bug.S for m68k-coff" .text .global SYM (_exit) .global SYM (outln) .global SYM (outbyte) .global SYM (putDebugChar) .global SYM (inbyte) .global SYM (getDebugChar) .global SYM (havebyte) /* * _exit -- Exit from the application. Normally we cause a user trap * to return to the ROM monitor for another run. */ .text .align 2 SYM (_exit): link fp, IMM(0) trap IMM(15) .word RETURN /* * inbyte -- get a byte from the serial port * d0 - contains the byte read in */ .text .align 2 SYM (getDebugChar): /* symbol name used by m68k-stub */ SYM (inbyte): link fp, IMM(-8) trap IMM(15) .word INCHR moveb sp@, d0 extw d0 extl d0 unlk fp rts /* * outbyte -- sends a byte out the serial port * d0 - contains the byte to be sent */ .text .align 2 SYM (putDebugChar): /* symbol name used by m68k-stub */ SYM (outbyte): link fp, IMM(-4) moveb fp@(11), sp@ trap IMM(15) .word OUTCHR unlk fp rts /* * outln -- sends a string of bytes out the serial port with a CR/LF * a0 - contains the address of the string's first byte * a1 - contains the address of the string's last byte */ .text .align 2 SYM (outln): link fp, IMM(-8) moveml a0/a1, sp@ trap IMM(15) .word OUTLN unlk fp rts /* * outstr -- sends a string of bytes out the serial port without a CR/LF * a0 - contains the address of the string's first byte * a1 - contains the address of the string's last byte */ .text .align 2 SYM (outstr): link fp, IMM(-8) moveml a0/a1, sp@ trap IMM(15) .word OUTSTR unlk fp rts /* * havebyte -- checks to see if there is a byte in the serial port, * returns 1 if there is a byte, 0 otherwise. */ .text .align 2 SYM (havebyte): trap IMM(15) .word INSTAT beqs empty movel IMM(1), d0 rts empty: movel IMM(0), d0 rts
stsp/newlib-ia16
10,693
libgloss/m68k/mvme162lx-asm.S
/* * mvme162lx-asm.S -- assembler routines for the MVME stub. * * This code was pulled out of mvme162lx-stub.c by Ian Taylor so that I * could handle different register and label prefixes in a sensible * way. */ /**************************************************************************** THIS SOFTWARE IS NOT COPYRIGHTED HP offers the following for use in the public domain. HP makes no warranty with regard to the software or it's performance and the user accepts the software "AS IS" with all faults. HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ****************************************************************************/ #include "asm.h" .title "mvme162lx-asm.S for m68k" .globl SYM (registers) .globl SYM (lastFrame) .globl SYM (superStack) .globl SYM (exceptionHook) .globl SYM (_returnFromException) .globl SYM (stackPtr) .globl SYM (handle_exception) .globl SYM (exceptionSize) .text .globl SYM (return_to_super) SYM (return_to_super): movel SYM (registers)+60,sp /* get new stack pointer */ movel SYM (lastFrame),a0 /* get last frame info */ bra return_to_any .globl SYM (return_to_user) SYM (return_to_user): movel SYM (registers)+60,a0 /* get usp */ movel a0,usp /* set usp */ movel SYM (superStack),sp /* get original stack pointer */ return_to_any: movel SYM (lastFrame),a0 /* get last frame info */ movel a0@+,SYM (lastFrame) /* link in previous frame */ addql IMM (8),a0 /* skip over pc, vector#*/ movew a0@+,d0 /* get # of words in cpu frame */ addw d0,a0 /* point to end of data */ addw d0,a0 /* point to end of data */ movel a0,a1 /* copy the stack frame */ subql IMM (1),d0 copyUserLoop: movew a1@-,sp@- dbf d0,copyUserLoop #ifdef __HAVE_68881__ fmoveml SYM (registers)+168,fpcr/fpsr/fpi fmovemx SYM (registers)+72,fp0-fp7 cmpl IMM (-1),a0@ /* skip frestore flag set ? */ beq skip_frestore frestore a0@+ skip_frestore: #endif moveml SYM (registers),d0-d7/a0-a6 rte /* pop and go! */ /* this function is called immediately when a level 7 interrupt occurs */ /* if the previous interrupt level was 7 then we're already servicing */ /* this interrupt and an rte is in order to return to the debugger. */ /* For the 68000, the offset for sr is 6 due to the jsr return address */ .text .globl SYM (_debug_level7) SYM (_debug_level7): movew d0,sp@- #ifdef mc68020 movew sp@(2),d0 #else movew sp@(6),d0 #endif andiw IMM (0x700),d0 cmpiw IMM (0x700),d0 beq _already7 movew sp@+,d0 bra SYM (_catchException) _already7: movew sp@+,d0 #ifndef mc68020 lea sp@(4),sp /* pull off 68000 return address */ #endif rte #ifdef mc68020 /* This function is called when a 68020 exception occurs. It saves * all the cpu and fpcp regs in the _registers array, creates a frame on a * linked list of frames which has the cpu and fpcp stack frames needed * to properly restore the context of these processors, and invokes * an exception handler (remcom_handler). * * stack on entry: stack on exit: * N bytes of junk exception # MSWord * Exception Format Word exception # MSWord * Program counter LSWord * Program counter MSWord * Status Register * * */ .text .globl SYM (_catchException) SYM (_catchException): oriw IMM (0x0700),sr /* Disable interrupts */ moveml d0-d7/a0-a6,SYM (registers) /* save registers */ movel SYM (lastFrame),a0 /* last frame pointer */ #ifdef __HAVE_68881__ /* do an fsave, then remember the address to begin a restore from */ fsave a0@- fmovemx fp0-fp7, SYM (registers)+72 fmoveml fpcr/fpsr/fpi, SYM (registers)+168 #endif lea SYM (registers),a5 /* get address of registers */ movew sp@,d1 /* get status register */ movew d1,a5@(66) /* save sr */ movel sp@(2),a4 /* save pc in a4 for later use */ movel a4,a5@(68) /* save pc in _regisers[] */ /* figure out how many bytes in the stack frame */ movew sp@(6),d0 /* get '020 exception format */ movew d0,d2 /* make a copy of format word */ andiw IMM (0xf000),d0 /* mask off format type */ rolw IMM (5),d0 /* rotate into the low byte *2 */ lea SYM (exceptionSize),a1 addw d0,a1 /* index into the table */ movew a1@,d0 /* get number of words in frame */ movew d0,d3 /* save it */ subw d0,a0 /* adjust save pointer */ subw d0,a0 /* adjust save pointer(bytes) */ movel a0,a1 /* copy save pointer */ subql IMM (1),d0 /* predecrement loop counter */ /* copy the frame */ saveFrameLoop: movew sp@+,a1@+ dbf d0,saveFrameLoop /* now that the stack has been clenaed, * save the a7 in use at time of exception */ movel sp,SYM (superStack) /* save supervisor sp */ andiw IMM (0x2000),d1 /* were we in supervisor mode ? */ beq userMode movel a7,a5@(60) /* save a7 */ bra a7saveDone userMode: movel usp,a1 movel a1,a5@(60) /* save user stack pointer */ a7saveDone: /* save size of frame */ movew d3,a0@- /* compute exception number */ andl IMM (0xfff),d2 /* mask off vector offset */ lsrw IMM (2),d2 /* divide by 4 to get vect num */ movel d2,a0@- /* save it */ /* save pc causing exception */ movel a4,a0@- /* save old frame link and set the new value*/ movel SYM (lastFrame),a1 /* last frame pointer */ movel a1,a0@- /* save pointer to prev frame */ movel a0,SYM (lastFrame) movel d2,sp@- /* push exception num */ #ifdef TMP_HACK movel SYM (exceptionHook),a0 /* get address of handler */ jbsr a0@ /* and call it */ #else jbsr SYM (remcomHandler) #endif clrl sp@ /* replace exception num parm with frame ptr */ jbsr SYM (_returnFromException) /* jbsr, but never returns */ #else /* mc68000 */ /* This function is called when an exception occurs. It translates the * return address found on the stack into an exception vector # which * is then handled by either handle_exception or a system handler. * _catchException provides a front end for both. * * stack on entry: stack on exit: * Program counter MSWord exception # MSWord * Program counter LSWord exception # MSWord * Status Register * Return Address MSWord * Return Address LSWord */ .text .globl SYM (_catchException) SYM (_catchException): oriw IMM (0x0700),sr /* Disable interrupts */ moveml d0-d7/a0-a6,SYM (registers) /* save registers */ movel SYM (lastFrame),a0 /* last frame pointer */ #ifdef __HAVE_68881__ /* do an fsave, then remember the address to begin a restore from */ fsave a0@- fmovemx fp0-fp7, SYM (registers)+72 fmoveml fpcr/fpsr/fpi, SYM (registers)+168 #endif lea SYM (registers),a5 /* get address of registers */ movel sp@+,d2 /* pop return address */ addl IMM (1530),d2 /* convert return addr to */ divs IMM (6),d2 /* exception number */ extl d2 moveql IMM (3),d3 /* assume a three word frame */ cmpiw IMM (3),d2 /* bus error or address error ? */ bgt normal /* if >3 then normal error */ movel sp@+,a0@- /* copy error info to frame buff*/ movel sp@+,a0@- /* these are never used */ moveql IMM (7),d3 /* this is a 7 word frame */ normal: movew sp@+,d1 /* pop status register */ movel sp@+,a4 /* pop program counter */ movew d1,a5@(66) /* save sr */ movel a4,a5@(68) /* save pc in _regisers[] */ movel a4,a0@- /* copy pc to frame buffer */ movew d1,a0@- /* copy sr to frame buffer */ movel sp,SYM (superStack) /* save supervisor sp */ andiw IMM (0x2000),d1 /* were we in supervisor mode ? */ beq userMode movel a7,a5@(60) /* save a7 */ bra saveDone userMode: movel usp,a1 /* save user stack pointer */ movel a1,a5@(60) /* save user stack pointer */ saveDone: movew d3,a0@- /* push frame size in words */ movel d2,a0@- /* push vector number */ movel a4,a0@- /* push exception pc */ /* save old frame link and set the new value */ movel SYM (lastFrame),a1 /* last frame pointer */ movel a1,a0@- /* save pointer to prev frame */ movel a0,SYM (lastFrame) movel d2,sp@- /* push exception num */ movel SYM (exceptionHook),a0 /* get address of handler */ jbsr a0@ /* and call it */ clrl sp@ /* replace exception num parm with frame ptr */ jbsr SYM (_returnFromException) /* jbsr, but never returns */ #endif /* m68000 */ /* * remcomHandler is a front end for handle_exception. It moves the * stack pointer into an area reserved for debugger use in case the * breakpoint happened in supervisor mode. */ .globl SYM (remcomHandler) SYM (remcomHandler): addl IMM (4),sp /* pop off return address */ movel sp@+,d0 /* get the exception number */ movel SYM (stackPtr),sp /* move to remcom stack area */ movel d0,sp@- /* push exception onto stack */ jbsr SYM (handle_exception) /* this never returns */ rts /* return */
stsp/newlib-ia16
1,146
libgloss/m68k/fido-hosted.S
/* * fido-hosted.S -- * * Copyright (c) 2006 CodeSourcery Inc * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ /* Semihosting function. The debugger intercepts the halt, and determines that it is followed by the sentinel pattern. */ .globl __hosted __hosted: linkw %fp,#0 movel %fp@(8),%d0 movel %fp@(12),%d1 .align 4 nop bkpt #0 /* This sentinel instruction value must be immediately after the bkpt instruction. The debugger will adjust the pc, so that it is never executed. This instruction is 'movec %sp,0'. */ .long 0x4e7bf000 unlk %fp rts
stsp/newlib-ia16
1,570
libgloss/m68k/cf-crt0.S
/* Initial boot * * Copyright (c) 2006 CodeSourcery Inc * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #include "asm.h" .text .extern __stack .extern __heap_end .weak __heap_end .extern __start1 /* __reset should cause a HALT in a hosted executable and fall into __start for an unhosted executable. The user is free to override this with their own declaration. */ .globl __reset .weak __reset __reset: #if HOSTED HALT #endif .globl __start __start: /* Initialize stack */ move.l IMM(__stack), sp move.l IMM(0), fp move.l IMM(__heap_end), d1 #if HOSTED /* INIT_SIM syscall. Allows changing sp & d1. */ move.l IMM(1),d0 /* The semihosting sequence is 'nop; halt;sentinel' aligned to a 4 byte boundary. The sentinel is an ill formed instruction (movec %sp,0). The debugger will adjust the pc, so it is never executed. */ .balignw 4,0x4e71 nop halt .long 0x4e7bf000 #endif move.l d1,sp@- move.l fp,sp@- /* Dummy return address */ jmp __start1
stsp/newlib-ia16
3,370
libgloss/m68k/cf-isv.S
/* The interrupt table. * * Copyright (c) 2006 CodeSourcery Inc * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ .macro SLOT,n,prefix=,suffix= .long __\prefix\n\suffix .endm .macro ISR n SLOT \n,interrupt, .endm .macro TRAP n SLOT \n,trap, .endm .macro FP n SLOT \n,fp_, .endm .macro UNIMP_OPCODE n SLOT \n,unimplemented_,_opcode .endm .macro BREAKPOINT_DEBUG n SLOT \n,,_breakpoint_debug_interrupt .endm .section .interrupt_vector,"a" .globl __interrupt_vector __interrupt_vector: .long __stack /* 0 */ .long __reset /* 1 */ .long __access_error /* 2 */ .long __address_error /* 3 */ .long __illegal_instruction /* 4 */ .long __divide_by_zero /* 5 */ ISR 6 ISR 7 .long __privilege_violation /* 8 */ .long __trace /* 9 */ UNIMP_OPCODE line_a /* 10 */ UNIMP_OPCODE line_f /* 11 */ BREAKPOINT_DEBUG non_pc /* 12 */ BREAKPOINT_DEBUG pc /* 13 */ .long __format_error /* 14 */ .irp N,15,16,17,18,19,20,21,22,23 ISR \N /* [15,24) */ .endr .long __spurious_interrupt /* 24 */ .irp N,25,26,27,28,29,30,31 ISR \N /* [25,32) */ .endr .irp N,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 TRAP \N /* [32,48) */ .endr FP branch_unordered /* 48 */ FP inexact_result /* 49 */ FP divide_by_zero /* 50 */ FP underflow /* 51 */ FP operand_error /* 52 */ FP overflow /* 53 */ FP input_not_a_number /* 54 */ FP input_denormalized_number /* 55 */ .irp N,56,57,58,59,60 ISR \N /* [56,61) */ .endr .long __unsupported_instruction /* 61 */ .irp N,62,63 ISR \N /* [62,64) */ .endr .irp N,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79 ISR \N /* [64,80) */ .endr .irp N,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95 ISR \N /* [80,96) */ .endr .irp N,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111 ISR \N /* [96,112) */ .endr .irp N,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127 ISR \N /* [112,128) */ .endr .irp N,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 ISR \N /* [128,144) */ .endr .irp N,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159 ISR \N /* [144,160) */ .endr .irp N,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175 ISR \N /* [160,176) */ .endr .irp N,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191 ISR \N /* [176,192) */ .endr .irp N,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207 ISR \N /* [192,208) */ .endr .irp N,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 ISR \N /* [208,224) */ .endr .irp N,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 ISR \N /* [224,240) */ .endr .irp N,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 ISR \N /* [240,256) */ .endr
stsp/newlib-ia16
4,215
libgloss/epiphany/crt0.S
# C Startup for EPIPHANY # Copyright (c) 2011, Adapteva, Inc. # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Adapteva nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. .section IVT,"a",@progbits ; .global _start; .type _start, %function; _start: .balign 4 ; b .normal_start .balign 4 ; 0x4 b .sw_exception_v .balign 4 ; 0x8 b .page_miss_v; .balign 4 ; 0xc b .timer0_expired_v .balign 4 ; 0x10 b .timer1_expired_v .balign 4 ; 0x14 b .message_v .balign 4 ; 0x18 b .dma0_v .balign 4 ; 0x1c b .dma1_v .balign 4 ; 0x20 b .wand_v .balign 4 ; 0x24 b .soft_v .size _start, .-_start .section RESERVED_CRT0,"a",@progbits ; .global .normal_start; .balign 4 .type .normal_start, %function .normal_start: mov r3,%low(_external_start) movt r3,%high(_external_start) jalr r3 .size .normal_start, .-.normal_start .section .text; .org 0x0000 ; Relative to start of text section .global _external_start .type _external_start, %function _external_start: .align 4 ;; Initialise the stack pointer and frame pointer. Hopefully __stack ;; is somewhere meaningful. mov sp,%low(___stack) movt sp,%high(___stack) mov fp,sp ;; Zero the data space mov r0,%low(___bss_start) movt r0,%high(___bss_start) mov r1,%low(_end) movt r1,%high(_end) mov r2,#0 mov r3,#0 .L0_init_: strd r2,[r0],+#1 sub r5,r1,r0 bne .L0_init_ ;; Setup destructors to be called from exit if main never returns #if 0 mov r0,%low(fini) movt r0,%high(fini) mov r2,%low(_atexit) movt r2,%high(_atexit) jalr r2 #else ; calling atexit drags in malloc, so instead poke the function ; address directly into the reent structure mov r2,%low(__impure_ptr) movt r2,%high(__impure_ptr) ldr r2,[r2] mov r1,%low(fini) movt r1,%high(fini) #ifdef __STRUCT_ALIGN_64__ #error add r2,r2,need_to_find_out; &_GLOBAL_REENT->atexit0 str r2, [r2,-1];??or -2?; _GLOBAL_REENT->atexit mov r0, 1 str r0, [r2,1] ; _GLOBAL_REENT->atexit0._ind str r1, [r2,2] ; _GLOBAL_REENT->atexit0._fns[0] #else /* !__STRUCT_ALIGN_64__ */ add r0,r2,0x14c ; &_GLOBAL_REENT->atexit0 str r0, [r0,-1] ; _GLOBAL_REENT->atexit mov r0, 1 strd r0, [r2,0x2a] ; _GLOBAL_REENT->atexit0._ind #endif /* !__STRUCT_ALIGN_64__ */ #endif /* !0 */ ;; Call global and static constructors mov r2,%low(init) movt r2,%high(init) jalr r2 ;;return from reset ISR mov R0,%low(RDS) movt R0,%high(RDS) movts iret,r0 rti RDS: ;; Initialise argc, argv and envp to empty and call main mov r0,#0 mov r1,#0 mov r2,#0 mov r3,%low(_main) movt r3,%high(_main) jalr r3 ;;bl _main ;; Call exit mov r3,%low(_exit) movt r3,%high(_exit) jalr r3 ;;bl _exit ;; Should never reach here idle .size _external_start, .-_external_start
stsp/newlib-ia16
1,785
libgloss/epiphany/_exit.S
# EPIPHANY implementation of _exit () # Copyright (c) 2011, Adapteva, Inc. # All rights reserved. # Contributor Joern Rennecke <joern.rennecke@embecosm.com> for Adapteva Inc # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Adapteva nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. */ .section .text .global __exit __exit: trap #3 ; exit b __exit
stsp/newlib-ia16
5,332
libgloss/epiphany/epiphany-ivthandlers.S
# EPIPHANY implementation of wrappers over user C ISR () # Copyright (c) 2011, Adapteva, Inc. # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Adapteva nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. .section RESERVED_CRT0,"a",@progbits ; .set sw_exception_v_n, 1 .set page_miss_v_n, 2 .set timer0_expired_v_n, 3; .set timer1_expired_v_n, 4; .set message_v_n, 5; .set dma0_v_n, 6; .set dma1_v_n, 7; .set wand_v_n, 8; .set soft_v_n, 9 // preserve isr-mods to ACTIVE, GID, KERNEL, WAND, & EXCAUSE bits in the status reg .set status_mask, 0x0007000f; // for the wand isr, preserve isr-mods to ACTIVE, GID, KERNEL, & EXCAUSE, but // clear the WAND bit. .set wand_status_mask, 0x00070007; //IVT wrappers .global _DEFAULT_ISR_CALLBACK; .balign 4 .type _DEFAULT_ISR_CALLBACK, %function _DEFAULT_ISR_CALLBACK: rts .size _DEFAULT_ISR_CALLBACK, .-_DEFAULT_ISR_CALLBACK .global _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v; .balign 4 .type _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v, %function _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v: trap 5;; FAIL .size _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v, .-_DEFAULT_ISR_CALLBACK_FOR_sw_exception_v .set NUMBER_ENTRIES_IN_IVT, 8 .global _ISR_VECTOR; .balign 4 .type _ISR_VECTOR, %object _ISR_VECTOR: .word _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v; reset .word _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v; sw_exception .word _DEFAULT_ISR_CALLBACK_FOR_sw_exception_v; page_miss .rept NUMBER_ENTRIES_IN_IVT .word _DEFAULT_ISR_CALLBACK .endr .size _ISR_VECTOR, .-_ISR_VECTOR .macro IVT_ENTRY_CALL entry_v_ ;; assuming we have valid frame poiter str fp, [sp],-0x10 str r0, [sp,+0xf] str r1, [sp,+0xe] mov r0, \entry_v_ .if \entry_v_ == wand_v_n mov r1, %low(wand_status_mask) ; this mask will exclude WAND, so it will movt r1, %high(wand_status_mask) ; be forcibly cleared .else mov r1, %low(status_mask) movt r1, %high(status_mask) .endif str r1, [sp,0x9] ; save the status register isr-preserve mask on the stack b __dispatcher .endm .global __dispatcher; .balign 4 .type __dispatcher, %function __dispatcher: str lr, [sp,+0xd] movfs.l r1,status str r1, [sp,+0xc] movfs.l r1,iret str r1, [sp,+0xb] str r2, [sp,+0xa] str r3, [sp,+0x8] mov fp,sp //TODO allow nesting //gie lsl r2, r0, 2 mov r1, %low(_ISR_VECTOR) add r2, r2, r1 ldr r1, [r2,0] ;; r1 = _ISR_VECTOR[entry_v] mov r2, 3 add r0, r0, r2 ;; r0 = signum jalr r1 mov sp,fp //gid // preserve isr-modifications to some of the bits in the status register, // but restore the rest to pre-interrupt values. // status = (status[post_isr] & status_mask) | (status[pre_isr] & ~status_mask) ldr.l r2, [sp, 9] ; fetch the status register isr preserve mask from the stack movfs r1, status and r1, r1, r2; (status[post_isr] & status_mask) ldr r0, [sp,+0xc] mov r2, %low(~status_mask) movt r2, %high(~status_mask) and r0, r0, r2; (status[pre_isr] & ~status_mask) orr r0, r0, r1 ; combine pre_isr & post_isr status bits movts.l status, r0 ldr r0, [sp,+0xb] movts.l iret,r0 ldr lr,[sp,+0xd]; ldr r1,[sp,+0xe] ldr r0,[sp,+0xf] ldr r2,[sp,+0xa] ldr r3,[sp,+0x8] ldr fp,[sp],+0x10 ldr fp,[sp,0] rti .size __dispatcher, .-__dispatcher .global .sw_exception_v; .type .sw_exception_v, %function .sw_exception_v: IVT_ENTRY_CALL sw_exception_v_n; .size .sw_exception_v, .-.sw_exception_v .global .page_miss_v; .type .page_miss_v, %function .page_miss_v: IVT_ENTRY_CALL page_miss_v_n; .size .page_miss_v, .-.page_miss_v .global .timer0_expired_v; .timer0_expired_v: IVT_ENTRY_CALL timer0_expired_v_n; .global .timer1_expired_v; .timer1_expired_v: IVT_ENTRY_CALL timer1_expired_v_n; .global .message_v; .message_v: IVT_ENTRY_CALL message_v_n; .global .dma0_v; .dma0_v: IVT_ENTRY_CALL dma0_v_n; .global .dma1_v; .dma1_v: IVT_ENTRY_CALL dma1_v_n; .global .wand_v; .wand_v: IVT_ENTRY_CALL wand_v_n; .global .soft_v; .soft_v: IVT_ENTRY_CALL soft_v_n;
stsp/newlib-ia16
1,530
libgloss/microblaze/linux-crt0.S
/* linux-crt0 -- Startup routines for the Linux BSP. * * Copyright (c) 2011 Edgar E. Iglesias * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ .section .text .globl _start .ent _start .type _start, @function _start: la r13, r0, _SDA_BASE_ la r2, r0, _SDA2_BASE_ brlid r15, __init nop lwi r5, r1, 0 addik r6, r1, 4 # Add argc * 4. addk r7, r5, r5 addk r7, r7, r7 brlid r15, main # Now add 4 + r1 (i.e r6) in the delayslot. addk r7, r7, r6 brlid r15, exit addik r5, r3, 0 .size _start, . - _start .end _start /* Replacement for the GCC provided crti.S. This one avoids the setup of stack protection regs (which result in privilieged insn exceptions when running in user-space). */ .section .init, "ax" .global __init .align 2 __init: addik r1, r1, -8 sw r15, r0, r1 .section .fini, "ax" .global __fini .align 2 __fini: addik r1, r1, -8 sw r15, r0, r1
stsp/newlib-ia16
1,276
libgloss/microblaze/linux-syscalls.S
/* linux-syscalls - Syscall interface to microblaze linux * * Copyright (c) 2011 Edgar E. Iglesias * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ #include "linux-syscalls.h" #define FUNC(name) .type name, %function; name: #define GLOBAL(name) .global name; FUNC(name) #define SIZE(name) .size name, .-name # define SYSCALL_BODY(name) \ addik r12, r0, SYS_ ## name; \ brki r14, 8; \ rtsd r15, 8; \ nop; # define SYSCALL(name) \ GLOBAL(_ ## name); \ SYSCALL_BODY(name); \ SIZE(_ ## name) SYSCALL(brk) SYSCALL(exit) SYSCALL(read) SYSCALL(write) SYSCALL(open) SYSCALL(close) SYSCALL(lseek) SYSCALL(fstat) SYSCALL(unlink) SYSCALL(getpid) SYSCALL(kill) SYSCALL(rt_sigaction)
stsp/newlib-ia16
2,767
libgloss/microblaze/sim-pgcrtinit.S
## Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## ## 1. Redistributions source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of Xilinx nor the names of its contributors may be ## used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS ## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ## TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # sim-pgcrtinit.s # # Default second stage of C run-time initialization for use with software # intrusive profiling. Does not peform BSS initialization to zero. # (Typical use is on a simulator) # .globl _crtinit .align 2 .ent _crtinit _crtinit: addi r1, r1, -20 /* Save Link register */ swi r15, r1, 0 brlid r15, _program_init /* Initialize the program */ nop brlid r15, _profile_init /* Initialize profiling library */ nop brlid r15, __init /* Invoke language initialization functions */ nop addi r6, r0, 0 /* Initialize argc = 1 and argv = NULL and envp = NULL */ addi r7, r0, 0 brlid r15, main /* Execute the program */ addi r5, r0, 0 brlid r15, __fini /* Invoke language cleanup functions */ nop brlid r15, _profile_clean /* Cleanup profiling library */ nop brlid r15, _program_clean /* Cleanup the program */ nop lw r15, r1, r0 /* Return back to CRT */ rtsd r15, 8 addi r1, r1, 20 .end _crtinit
stsp/newlib-ia16
1,696
libgloss/microblaze/_hw_exception_handler.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .text .globl _hw_exception_handler # HW Exception Handler Label .align 2 _hw_exception_handler: rted r17, 0 nop
stsp/newlib-ia16
3,007
libgloss/microblaze/crtinit.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .globl _crtinit .align 2 .ent _crtinit .type _crtinit, @function _crtinit: addi r1, r1, -20 /* Save Link register */ swi r15, r1, 0 addi r6, r0, __sbss_start /* clear SBSS */ addi r7, r0, __sbss_end rsub r18, r6, r7 blei r18, .Lendsbss .Lloopsbss: swi r0, r6, 0 addi r6, r6, 4 rsub r18, r6, r7 bgti r18, .Lloopsbss .Lendsbss: addi r6, r0, __bss_start /* clear BSS */ addi r7, r0, __bss_end rsub r18, r6, r7 blei r18, .Lendbss .Lloopbss: swi r0, r6, 0 addi r6, r6, 4 rsub r18, r6, r7 bgti r18, .Lloopbss .Lendbss: brlid r15, _program_init /* Initialize the program */ nop brlid r15, __init /* Invoke language initialization functions */ nop addi r6, r0, 0 /* Initialize argc = 1 and argv = NULL and envp = NULL */ addi r7, r0, 0 brlid r15, main /* Execute the program */ addi r5, r0, 0 addik r19, r3, 0 /* Save return value */ brlid r15, __fini /* Invoke language cleanup functions */ nop brlid r15, _program_clean /* Cleanup the program */ nop lw r15, r1, r0 /* Return back to CRT */ addik r3, r19, 0 /* Restore return value */ rtsd r15, 8 addi r1, r1, 20 .end _crtinit
stsp/newlib-ia16
3,537
libgloss/microblaze/crt2.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MicroBlaze Vector Map for standalone executables that are boot-strapped Address Vector type Label ------- ----------- ------ # 0x00 # (-- IMM --) # 0x04 # Reset (-- Don't Care --) # 0x08 # (-- IMM --) # 0x0c # Software Exception _exception_handler # 0x10 # (-- IMM --) # 0x14 # Hardware Interrupt _interrupt_handler # 0x18 # (-- IMM --) # 0x1C # Breakpoint Exception (-- Don't Care --) # 0x20 # (-- IMM --) # 0x24 # Hardware Exception _hw_exception_handler */ .section .vectors.sw_exception, "ax" .align 2 _vector_sw_exception: brai _exception_handler .section .vectors.interrupt, "ax" .align 2 _vector_interrupt: brai _interrupt_handler .section .vectors.hw_exception, "ax" .align 2 _vector_hw_exception: brai _hw_exception_handler .section .text .globl _start .align 2 .ent _start .type _start, @function _start: la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ la r2, r0, _SDA2_BASE_ la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ brlid r15, _crtinit /* Initialize BSS and run program */ nop brlid r15, exit /* Call exit with the return value of main */ addik r5, r3, 0 /* Control does not reach here */ .end _start /* _exit Our simple _exit */ .globl _exit .align 2 .ent _exit .type _exit, @function _exit: bri 0 .end _exit
stsp/newlib-ia16
3,674
libgloss/microblaze/crt0.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MicroBlaze Vector Map for standalone executables Address Vector type Label ------- ----------- ------ # 0x00 # (-- IMM --) # 0x04 # Reset _start1 # 0x08 # (-- IMM --) # 0x0c # Software Exception _exception_handler # 0x10 # (-- IMM --) # 0x14 # Hardware Interrupt _interrupt_handler # 0x18 # (-- IMM --) # 0x1C # Breakpoint Exception (-- Don't Care --) # 0x20 # (-- IMM --) # 0x24 # Hardware Exception _hw_exception_handler */ .globl _start .section .vectors.reset, "ax" .align 2 .ent _start .type _start, @function _start: brai _start1 .end _start .section .vectors.sw_exception, "ax" .align 2 _vector_sw_exception: brai _exception_handler .section .vectors.interrupt, "ax" .align 2 _vector_interrupt: brai _interrupt_handler .section .vectors.hw_exception, "ax" .align 2 _vector_hw_exception: brai _hw_exception_handler .section .text .globl _start1 .align 2 .ent _start1 .type _start1, @function _start1: la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ la r2, r0, _SDA2_BASE_ la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ brlid r15, _crtinit /* Initialize BSS and run program */ nop brlid r15, exit /* Call exit with the return value of main */ addik r5, r3, 0 /* Control does not reach here */ .end _start1 /* _exit Our simple _exit */ .globl _exit .align 2 .ent _exit .type _exit, @function _exit: bri 0 .end _exit
stsp/newlib-ia16
1,725
libgloss/microblaze/_exception_handler.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .text .align 2 .weakext _exception_handler .ent _exception_handler .type _exception_handler, @function _exception_handler: addi r11,r11,8 bra r11
stsp/newlib-ia16
1,745
libgloss/microblaze/_program_clean.S
## Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## ## 1. Redistributions source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of Xilinx nor the names of its contributors may be ## used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS ## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ## TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # _program_clean.s # # Dummy file to be replaced by LibGen # .text .align 2 .globl _program_clean .ent _program_clean _program_clean: rtsd r15,8 nop .end _program_clean
stsp/newlib-ia16
3,124
libgloss/microblaze/crt3.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MicroBlaze Vector Map for vector-less ELF images Address Vector type Label ------- ----------- ------ # 0x00 # (-- IMM --) # 0x04 # Reset (-- Don't Care --) # 0x08 # (-- IMM --) # 0x0c # Software Exception (-- Don't Care --) # 0x10 # (-- IMM --) # 0x14 # Hardware Interrupt (-- Don't Care --) # 0x18 # (-- IMM --) # 0x1C # Breakpoint Exception (-- Don't Care --) # 0x20 # (-- IMM --) # 0x24 # Hardware Exception (-- Don't Care --) */ .section .text .globl _start .align 2 .ent _start .type _start, @function _start: la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ la r2, r0, _SDA2_BASE_ la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ brlid r15, _crtinit /* Initialize BSS and run program */ nop brlid r15, exit /* Call exit with the return value of main */ addik r5, r3, 0 /* Control does not reach here */ .end _start /* _exit Our simple _exit */ .globl _exit .align 2 .ent _exit .type _exit, @function _exit: bri 0 .end _exit
stsp/newlib-ia16
1,738
libgloss/microblaze/_program_init.S
## Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## ## 1. Redistributions source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of Xilinx nor the names of its contributors may be ## used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS ## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ## TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # _program_init.s # # Dummy file to be replaced by LibGen .text .align 2 .globl _program_init .ent _program_init _program_init: rtsd r15,8 nop .end _program_init
stsp/newlib-ia16
3,633
libgloss/microblaze/crt1.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MicroBlaze Vector Map for standalone executables downloaded and executed with XMDSTUB Address Vector type Label ------- ----------- ------ # 0x00 # (-- IMM --) # 0x04 # Reset (-- Don't Care --) # 0x08 # (-- IMM --) # 0x0c # Software Exception _exception_handler # 0x10 # (-- IMM --) # 0x14 # Hardware Interrupt _interrupt_handler # 0x18 # (-- IMM --) # 0x1C # Breakpoint Exception (-- Don't Care --) # 0x20 # (-- IMM --) # 0x24 # Hardware Exception _hw_exception_handler */ .section .vectors.sw_exception, "ax" .align 2 _vector_sw_exception: brai _exception_handler .section .vectors.interrupt, "ax" .align 2 _vector_interrupt: brai _interrupt_handler .section .vectors.hw_exception, "ax" .align 2 _vector_hw_exception: brai _hw_exception_handler .section .text .globl _start .align 2 .ent _start .type _start, @function _start: la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ la r2, r0, _SDA2_BASE_ la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ brlid r15, _crtinit /* Initialize BSS and run program */ nop brlid r15, exit /* Call exit with the return value of main */ addik r5, r3, 0 /* Control does not reach here */ .end _start /* _exit Our simple _exit */ .globl _exit .align 2 .ent _exit .type _exit, @function _exit: add r3, r0, r5 brki r16, 0x4 /* Return to hook in XMDSTUB */ .end _exit
stsp/newlib-ia16
1,686
libgloss/microblaze/_interrupt_handler.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .text .globl _interrupt_handler # Interrupt Handler Label .align 2 _interrupt_handler: rtid r14, 0 nop
stsp/newlib-ia16
3,158
libgloss/microblaze/crt4.S
/* Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Xilinx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MicroBlaze Vector Map for Xilkernel ELF process images Address Vector type Label ------- ----------- ------ # 0x00 # (-- IMM --) # 0x04 # Reset (-- Don't Care --) # 0x08 # (-- IMM --) # 0x0c # Software Exception (-- Don't Care --) # 0x10 # (-- IMM --) # 0x14 # Hardware Interrupt (-- Don't Care --) # 0x18 # (-- IMM --) # 0x1C # Breakpoint Exception (-- Don't Care --) # 0x20 # (-- IMM --) # 0x24 # Hardware Exception (-- Don't Care --) */ .section .text .globl _start .align 2 .ent _start .type _start, @function _start: la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ la r2, r0, _SDA2_BASE_ la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ brlid r15, _crtinit /* Initialize BSS and run program */ nop brlid r15, exit /* Call exit with the return value of main */ addik r5, r3, 0 /* Control does not reach here */ .end _start /* _exit Our simple _exit */ .globl _exit .align 2 .ent _exit .type _exit, @function _exit: brlid r15,elf_process_exit nop .end _exit
stsp/newlib-ia16
3,152
libgloss/microblaze/pgcrtinit.S
## Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## ## 1. Redistributions source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of Xilinx nor the names of its contributors may be ## used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS ## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ## TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .globl _crtinit .align 2 .ent _crtinit _crtinit: addi r1, r1, -20 /* Save Link register */ swi r15, r1, 0 addi r6, r0, __sbss_start /* clear SBSS */ addi r7, r0, __sbss_end rsub r18, r6, r7 blei r18, .Lendsbss .Lloopsbss: swi r0, r6, 0 addi r6, r6, 4 rsub r18, r6, r7 bgti r18, .Lloopsbss .Lendsbss: addi r6, r0, __bss_start /* clear BSS */ addi r7, r0, __bss_end rsub r18, r6, r7 blei r18, .Lendbss .Lloopbss: swi r0, r6, 0 addi r6, r6, 4 rsub r18, r6, r7 bgti r18, .Lloopbss .Lendbss: brlid r15, _program_init /* Initialize the program */ nop brlid r15, _profile_init /* Initialize profiling library */ nop brlid r15, __init /* Invoke language initialization functions */ nop addi r6, r0, 0 /* Initialize argc = 1 and argv = NULL and envp = NULL */ addi r7, r0, 0 brlid r15, main /* Execute the program */ addi r5, r0, 0 addik r19, r3, 0 /* Save return value */ brlid r15, __fini /* Invoke language cleanup functions */ nop brlid r15, _profile_clean /* Cleanup profiling library */ nop brlid r15, _program_clean /* Cleanup the program */ nop lw r15, r1, r0 /* Return back to CRT */ addik r3, r19, 0 /* Restore return value */ rtsd r15, 8 addi r1, r1, 20 .end _crtinit
stsp/newlib-ia16
2,699
libgloss/microblaze/sim-crtinit.S
## Copyright (c) 2001, 2009 Xilinx, Inc. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are ## met: ## ## 1. Redistributions source code must retain the above copyright notice, ## this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of Xilinx nor the names of its contributors may be ## used to endorse or promote products derived from this software without ## specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS ## IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ## PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ## TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ## LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ## NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ## SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # sim-crtinit.s # # Default second stage of C run-time initialization that does not peform # BSS initialization to zero. Typical use is on a simulator. # .globl _crtinit .align 2 .ent _crtinit _crtinit: addi r1, r1, -20 /* Save Link register */ swi r15, r1, 0 brlid r15, _program_init /* Initialize the program */ nop brlid r15, __init /* Invoke language initialization functions */ nop addi r6, r0, 0 /* Initialize argc = 1 and argv = NULL and envp = NULL */ addi r7, r0, 0 brlid r15, main /* Execute the program */ addi r5, r0, 0 addik r19, r3, 0 /* Save return value */ brlid r15, __fini /* Invoke language cleanup functions */ nop brlid r15, _program_clean /* Cleanup the program */ nop lw r15, r1, r0 /* Return back to CRT */ addik r3, r19, 0 /* Restore return value */ rtsd r15, 8 addi r1, r1, 20 .end _crtinit
stsp/newlib-ia16
2,536
libgloss/spu/crtn.S
# (C) Copyright IBM Corp. 2005, 2006 # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of IBM nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # This file just makes sure that the .fini and .init sections do in # fact return. Users may put any desired instructions in those sections. # This file is the last thing linked into any executable. # Note - this macro is complimented by the FUNC_START macro # in crti.S. If you change this macro you must also change # that macro match. # # Note - we do not try any fancy optimisations of the return # sequences here, it is just not worth it. Instead keep things # simple. The link register is restored and then the correct # function return instruction is performed. .macro FUNC_END ai $sp, $sp, 32 lqd $lr, 16($sp) bi $lr .endm .file "crtn.S" .section ".init" FUNC_END .section ".fini" FUNC_END # To ensure nothing is linked at address 0, provide a dummy # .interrupt section. This is in crtn.S to make sure any # user-provided real .interrupt section will get linked # in front of this dummy. .section ".interrupt","ax" .align 2 heq $0,$0 # end of crtn.S
stsp/newlib-ia16
4,926
libgloss/spu/crt0.S
/* (C) Copyright IBM Corp. 2005, 2006 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of IBM nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* crt0.S - entry function for C Runtime. * * With _STD_MAIN switch, the crt0.S will be compiled to crt2.o. * The crt2.o sets up a C99-style interface for the SPU application's * main() function, including a local copy of argv strings. * * The number of argument strings is passed in R3. The size and EA * location of the argument vector region is passed in R4. Once the * argv region is copied to the highest range of LS, and $SP is set * just below it. * * Without _STD_MAIN, the crt0.S is compiled to crt1.o. * The crt1.o prepares the entry for an SPU module. The main() function * is called with different parameter list: spu_id, param and env * are passed by R3, R4 and R5 respectively. */ #ifdef _STD_MAIN #define MFC_TAG_UPDATE_ALL 2 #define MFC_GET_CMD 0x40 #define TAGID 0 #define TAGMASK 1 #endif .comm __ea_local_store,16,16 .text .global _start .type _start, @function _start: /* Save the local store base from $6. */ stqr $6, __ea_local_store #ifdef _STD_MAIN /* * Copy the argument vector region from EA to LS. The DMA * parameters are passed in R4: * * +-------+-------+-------+-------+ * R4 | LS | EA-HI | EA-LO | SIZE | * +-------+-------+-------+-------+ * word 0 1 2 3 * * By the end of this sequence, the prefered slot (word 0) of * R4 will contain the LS offset of argv region, which also * serves as the base offset for $SP. */ wrch $MFC_LSA, $4 rotqbyi $4, $4, 4 wrch $MFC_EAH, $4 rotqbyi $4, $4, 4 wrch $MFC_EAL, $4 rotqbyi $4, $4, 4 wrch $MFC_Size, $4 rotqbyi $4, $4, 4 il $LR, TAGID wrch $MFC_TagID, $LR /* Issue MFC_GET_CMD, then wait for transfer of argument * vector region to complete. */ il $LR, MFC_GET_CMD wrch $MFC_Cmd, $LR il $LR, TAGMASK wrch $MFC_WrTagMask, $LR il $LR, MFC_TAG_UPDATE_ALL wrch $MFC_WrTagUpdate, $LR rdch $LR, $MFC_RdTagStat #endif /* Save parameter list of main function to the non-volatile * registers. spu_thread module has three parameters, while * spulet only has two. */ ori $80, $3, 0 ori $81, $4, 0 #ifndef _STD_MAIN ori $82, $5, 0 #endif /* The Link Register is initialized to NULL. */ il $LR, 0 #ifdef _STD_MAIN /* For spulet, initialize stack pointer just below the argv region. */ ai $SP,$4,-16 #else /* For spe_thread module, the stack pointer is initialized * below the area where __stack points to. */ ila $SP,__stack #endif /* Initialize back chain to NULL. */ stqd $LR,0($SP) /* Allocate 2 slots for stack frame. */ stqd $SP,-32($SP) ai $SP,$SP,-32 /* Save the Link Register in Link Register Save Area. */ stqd $LR,16($SP) /* Calculate stack size. */ ila $3,_end sf $3,$3,$SP rotqbyi $3,$3,12 /* The BE Linux ABI passes the stack size in $2, or use * the default if $2 == 0. */ rotqbyi $4,$2,12 ceqi $5,$4,0 selb $3,$4,$3,$5 fsmbi $4,3840 selb $SP,$SP,$3,$4 /* Call the _init function. */ brsl $LR, _init /* Call the _fini function at exit time. */ ila $3, _fini brsl $LR, atexit #ifdef _PROFILE /* Call monstartup if profiling is enabled */ #ifdef _STD_MAIN ila $3,0 #else ori $3,$80,0 #endif brsl $LR, __monstartup #endif ori $3,$80,0 ori $4,$81,0 #ifndef _STD_MAIN ori $5,$82,0 #endif /* Call the programs main. */ brsl $LR, main /* Call exit. */ brsl $LR, exit
stsp/newlib-ia16
2,289
libgloss/spu/crti.S
# (C) Copyright IBM Corp. 2005, 2006 # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of IBM nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # This file just make a stack frame for the contents of the .fini and # .init sections. Users may put any desired instructions in those # sections. # Note - this macro is complimented by the FUNC_END macro # in crtn.S. If you change this macro you must also change # that macro match. .macro FUNC_START # Create a stack frame with two slots: LR and BC # The .init and .fini section don't change the call-preserved # registes, therefore no need to save them. stqd $lr, 16($sp) stqd $sp, -32($sp) ai $sp, $sp, -32 .endm .file "crti.S" .section ".init" .align 2 .global _init .type _init, @function _init: FUNC_START .section ".fini" .align 2 .global _fini .type _fini, @function _fini: FUNC_START
stsp/newlib-ia16
1,685
libgloss/nds32/_open.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _open, VH_OPEN #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _open, SYS_open #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
2,813
libgloss/nds32/_sbrk.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "../syscall.h" #include "syscall_extra.h" .extern _impure_ptr /* The first element is _errno. */ .extern _end .global _sbrk .type _sbrk, @function .text .align 2 _sbrk: /* Get the value stored in heap_end (Top of Heap). If the value is zero, initialize it with the ending of bss section and leave a 1024-byte room to do low memory action. */ l.w $r1, heap_end bnez $r1, .L0 /* Note: leave 1024 byte to do low memory action. */ la $r1, _end + 1024 s.w $r1, heap_end .L0: /* Try to increments heap_end by $r0 bytes. Check if collision happens ? If collision happens, -1 is returned and errno is set to ENOMEM. Otherwise, save new value to heap_end and return the previous heap_end. */ /* Make sure new heap_end is aligned on 8-byte boundary. */ addi $r0, $r0, 7 srli $r0, $r0, 3 slli $r0, $r0, 3 add $r0, $r1, $r0 /* Set $r0 as new heap_end. */ slt $r2, $sp, $r0 /* Set $r2 if $sp is lower than heap_end. */ bnez $r2, .Lerror /* Branch if collision happens. */ s.w $r0, heap_end /* Save new value to heap_end. */ move $r0, $r1 /* Return the previous heap_end. */ ret .Lerror: movi $r0, 12 l.w $r15, _impure_ptr swi $r0, [$r15] /* Set errno. */ movi $r0, -1 /* Reture value is -1. */ ret .size _sbrk, .-_sbrk .section .bss .align 2 heap_end: .word 0
stsp/newlib-ia16
2,014
libgloss/nds32/_link.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. */ .extern _impure_ptr /* The first element is _errno. */ .text .global _link .type _link, @function .align 2 _link: /* A minimal implementation has no file system, so this function must always fail, with an appropriate value set in errno. */ movi $r0, #31 /* EMLINK: Too many links */ l.w $r15, _impure_ptr swi $r0, [$r15] movi $r0, -1 /* Set return value to -1. */ ret .size _link, .-_link
stsp/newlib-ia16
1,690
libgloss/nds32/_fstat.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _fstat, VH_FSTAT #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _fstat, SYS_fstat #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,739
libgloss/nds32/_getpid.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .text .global _getpid .type _getpid, @function .align 2 _getpid: /* The getpid() function shall always be successful and no return value is reserved to indicate an error. */ movi $r0, 1 /* A minimal implementation, success. */ ret .size _getpid, .-_getpid
stsp/newlib-ia16
1,685
libgloss/nds32/_read.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _read, VH_READ #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _read, SYS_read #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,604
libgloss/nds32/_argvlen.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _argvlen, SYS_argvlen #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,689
libgloss/nds32/_close.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _close, VH_CLOSE #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _close, SYS_close #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,598
libgloss/nds32/_argv.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _argv, SYS_argv #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
6,071
libgloss/nds32/crt0.S
/* Copyright (c) 2013-2014 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ##============================================================================== ## ## crt0.S ## ## nds32 startup code ## ##============================================================================== #include "syscall_extra.h" ##------------------------------------------------------------------------------ ## Vector table setup ##------------------------------------------------------------------------------ .section .nds32_init, "ax" j _start ##------------------------------------------------------------------------------ ## Startup code implementation ##------------------------------------------------------------------------------ .section .text .weak _SDA_BASE_ .weak _ITB_BASE_ .weak _arg_init .weak __pre_c_init .weak __post_c_init .weak _call_exit .global _start .type _start, @function .align 2 _start: /* The initialization sequence really does matter !!! The global pointer must be initialized precedence over all others. */ .L_init_gp: /* Initialization for global pointer. The symbol _SDA_BASE_ is determined by Linker. SDA stands for Small Data Access. */ la $gp, _SDA_BASE_ #if __NDS32_EXT_EX9__ .L_init_itb: /* Initialization for Instruction Table Base (ITB). The symbol _ITB_BASE_ is determined by Linker. Set $ITB only if MSC_CFG.EIT (cr4.b'24) is set. */ mfsr $r0, $MSC_CFG srli $r0, $r0, 24 andi $r0, $r0, 0x1 beqz $r0, 1f /* Fall through ? */ la $r0, _ITB_BASE_ mtusr $r0, $ITB 1: #endif .L_init_sp: /* Initialization for stack pointer. The symbol _stack is defined in linker script. Make sure $sp is 8-byte aligned. */ la $sp, _stack #if __NDS32_ISA_V3__ bitci $sp, $sp, #7 #else movi $r0, #-8 /* Set $r0 as 0xFFFFFFF8. */ and $sp, $sp, $r0 #endif #if __NDS32_EXT_FPU_SP__ || __NDS32_EXT_FPU_DP__ .L_init_fpu: /* Initialize FPU Set FUCOP_CTL.CP0EN (fucpr.b'0). */ mfsr $r0, $FUCOP_CTL ori $r0, $r0, 0x1 mtsr $r0, $FUCOP_CTL dsb /* According to [bugzilla #9425], set flush-to-zero mode. That is, set $FPCSR.DNZ(b'12) = 1. */ FMFCSR $r0 ori $r0, $r0, 0x1000 FMTCSR $r0 dsb #endif .L_pre_c_init: ! call __pre_c_init if provided ! sample __pre_c_init is in BSP la $r15, __pre_c_init ! load address of __pre_c_init beqz $r15, .L_zero_out_bss ! check existence of __pre_c_init jral $r15 ! pre-c-runtime initialization .L_zero_out_bss: /* Zero out the bss section. Equivalence C code for follow part: if (_end == _edata) goto .L_post_c_init unsinged int *ptr = _edata; while (ptr != _end) *ptr++ = 0 $r0 = ptr/_edata $r1 = _end $r2 = 0 */ la $r0, _edata la $r1, _end movi $r2, #0 beq $r0, $r1, .L_post_c_init /* Branch if no bss. */ .Lword_clear: swi.bi $r2, [$r0], #4 bne $r0, $r1, .Lword_clear .L_post_c_init: ! call __post_c_init if provided ! no sample __post_c_init is provided la $r15, __post_c_init ! load address of __post_c_init beqz $r15, .L_arg_init ! check existence of __post_c_init jral $r15 ! post-c-runtime initialization .L_arg_init: ! argc/argv initialization if necessary la $r7, _arg_init ! get address of _arg_init beqz $r7, .L_clean_reg ! if there isn't _arg_init, go main addi $sp, $sp, -512 ! allocate space for command line ! and arguments move $r6, $sp ! r6 = buffer addr of cmd line move $r0, $r6 ! r0 = buffer addr of cmd line syscall SYS_getcmdline ! get cmd line move $r0, $r6 ! r0 = buffer addr of cmd line addi $r1, $r6, 256 ! r1 = argv jral $r7 ! init argc/argv addi $r1, $r6, 256 ! r1 = argv b .L_call_main .L_clean_reg: /* Prepare argc/argv/env for main function. Since there is no operating system so far, we set $r0, $r1, and $r2 to be zero. Note: $r2 already set to zero in .L_zero_out_bss: code fragment. */ movi $r0, 0 movi $r1, 0 movi $r2, 0 .L_call_main: /* Call 'main'. */ bal main /* Call _call_exit. */ ! call _call_exit if necessary; default implementation is in crtexit.c la $r15, _call_exit ! load address of _call_exit beqz $r15, .L_terminate_program ! no _call_exit? go exit jral $r15 ! _call_exit will never return .L_terminate_program: /* There are two ways to terminate program: 1. User "syscall 0x1" directly. 2. Call exit. The return value $r0 from main() is implicitly passed as argument. Currently, we use option 2 as a solution to follow C99 5.1.2.2.3, but aware that general exit() will do some cleanup procedures which may result in large-memory-footprints. */ bal exit .L_forever_loop: /* Should never return here. */ b .L_forever_loop .size _start, .-_start
stsp/newlib-ia16
1,991
libgloss/nds32/_times.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* If times() fails, (clock_t)-1 shall be returned and errno set to indicate the error. */ .extern _impure_ptr /* The first element is _errno. */ .text .global _times .type _times, @function .align 2 _times: /* A minimal implementation need not offer any timing information, so should always fail with an appropriate value in errno. */ movi $r0, #13 /* EACCES: Permission denied */ l.w $r15, _impure_ptr swi $r0, [$r15] movi $r0, -1 /* Set return value to -1. */ ret .size _times, .-_times
stsp/newlib-ia16
1,598
libgloss/nds32/_time.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _time, SYS_time #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
6,259
libgloss/nds32/crt1.S
/* Copyright (c) 2013-2014 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ##============================================================================== ## ## crt1.S ## ## nds32 startup code ## ##============================================================================== #include "syscall_extra.h" ##------------------------------------------------------------------------------ ## Vector table setup ##------------------------------------------------------------------------------ .section .nds32_init, "ax" j _start ##------------------------------------------------------------------------------ ## Startup code implementation ##------------------------------------------------------------------------------ .section .text .weak _SDA_BASE_ .weak _ITB_BASE_ .weak _arg_init .weak __pre_c_init .weak __post_c_init .weak _call_exit .global _start .type _start, @function .align 2 _start: /* The initialization sequence really does matter !!! The global pointer must be initialized precedence over all others. */ .L_init_gp: /* Initialization for global pointer. The symbol _SDA_BASE_ is determined by Linker. SDA stands for Small Data Access. */ la $gp, _SDA_BASE_ #if __NDS32_EXT_EX9__ .L_init_itb: /* Initialization for Instruction Table Base (ITB). The symbol _ITB_BASE_ is determined by Linker. Set $ITB only if MSC_CFG.EIT (cr4.b'24) is set. */ mfsr $r0, $MSC_CFG srli $r0, $r0, 24 andi $r0, $r0, 0x1 beqz $r0, 1f /* Fall through ? */ la $r0, _ITB_BASE_ mtusr $r0, $ITB 1: #endif .L_init_sp: /* Initialization for stack pointer. The symbol _stack is defined in linker script. Make sure $sp is 8-byte aligned. */ la $sp, _stack #if __NDS32_ISA_V3__ bitci $sp, $sp, #7 #else movi $r0, #-8 /* Set $r0 as 0xFFFFFFF8. */ and $sp, $sp, $r0 #endif #if __NDS32_EXT_FPU_SP__ || __NDS32_EXT_FPU_DP__ .L_init_fpu: /* Initialize FPU Set FUCOP_CTL.CP0EN (fucpr.b'0). */ mfsr $r0, $FUCOP_CTL ori $r0, $r0, 0x1 mtsr $r0, $FUCOP_CTL dsb /* According to [bugzilla #9425], set flush-to-zero mode. That is, set $FPCSR.DNZ(b'12) = 1. */ FMFCSR $r0 ori $r0, $r0, 0x1000 FMTCSR $r0 dsb #endif .L_pre_c_init: ! call __pre_c_init if provided ! sample __pre_c_init is in BSP la $r15, __pre_c_init ! load address of __pre_c_init beqz $r15, .L_zero_out_bss ! check existence of __pre_c_init jral $r15 ! pre-c-runtime initialization .L_zero_out_bss: /* Zero out the bss section. Equivalence C code for follow part: if (_end == _edata) goto .L_call_main unsinged int *ptr = _edata; while (ptr != _end) *ptr++ = 0 $r0 = ptr/_edata $r1 = _end $r2 = 0 */ la $r0, _edata la $r1, _end movi $r2, #0 beq $r0, $r1, .L_cpp_init /* Branch if no bss. */ .Lword_clear: swi.bi $r2, [$r0], #4 bne $r0, $r1, .Lword_clear .L_cpp_init: /* Call '_init' to invoke constructors. */ jal _init /* Register '_fini' into atexit() to invoke destructors when exit() has been reached. */ la $r0, _fini jal atexit .L_post_c_init: ! call __post_c_init if provided ! no sample __post_c_init is provided la $r15, __post_c_init ! load address of __post_c_init beqz $r15, .L_arg_init ! check existence of __post_c_init jral $r15 ! post-c-runtime initialization .L_arg_init: ! argc/argv initialization if necessary la $r7, _arg_init ! get address of _arg_init beqz $r7, .L_clean_reg ! if there isn't _arg_init, go main addi $sp, $sp, -512 ! allocate space for command line ! and arguments move $r6, $sp ! r6 = buffer addr of cmd line move $r0, $r6 ! r0 = buffer addr of cmd line syscall SYS_getcmdline ! get cmd line move $r0, $r6 ! r0 = buffer addr of cmd line addi $r1, $r6, 256 ! r1 = argv jral $r7 ! init argc/argv addi $r1, $r6, 256 ! r1 = argv b .L_call_main .L_clean_reg: /* Prepare argc/argv/env for main function. Since there is no operating system so far, we set $r0, $r1, and $r2 to be zero. Note: $r2 already set to zero in .L_zero_out_bss: code fragment. */ movi $r0, 0 movi $r1, 0 movi $r2, 0 .L_call_main: /* Call 'main'. */ bal main /* Call _call_exit. */ ! call _call_exit if necessary; default implementation is in crtexit.c la $r15, _call_exit ! load address of _call_exit beqz $r15, .L_terminate_program ! no _call_exit? go exit jral $r15 ! _call_exit will never return .L_terminate_program: /* There are two ways to terminate program: 1. User "syscall 0x1" directly. 2. Call exit. The return value $r0 from main() is implicitly passed as argument. Currently, we use option 2 as a solution to follow C99 5.1.2.2.3, but aware that general exit() will do some cleanup procedures which may result in large-memory-footprints. */ bal exit .L_forever_loop: /* Should never return here. */ b .L_forever_loop .size _start, .-_start
stsp/newlib-ia16
1,600
libgloss/nds32/_utime.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _utime, SYS_utime #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,689
libgloss/nds32/_write.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _write, VH_WRITE #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _write, SYS_write #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,600
libgloss/nds32/_chdir.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _chdir, SYS_chdir #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,693
libgloss/nds32/_system.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _system, VH_SYSTEM #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _system, SYS_system #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,685
libgloss/nds32/_stat.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _stat, VH_STAT #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _stat, SYS_stat #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,767
libgloss/nds32/_exit.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "vh.h" #include "../syscall.h" .text .global _exit .type _exit, @function .align 2 _exit: #ifdef __NDS32_VH__ BREAK VH_EXIT /* Generate_Exception(Breakpoint); */ #else syscall SYS_exit /* Make syscall 'SYS_exit'. */ #endif .L_infinite_loop: b .L_infinite_loop .size _exit, .-_exit
stsp/newlib-ia16
2,330
libgloss/nds32/_isatty.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* SYNOPSIS #include <unistd.h> int isatty(int fildes); RETURN VALUE The isatty() function shall return 1 if fildes is associated with a terminal; otherwise, it shall return 0 and may set errno to indicate the error. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE0 _isatty, VH_ISATTY #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" .text .global _isatty .type _isatty, @function .align 2 _isatty: syscall SYS_isatty /* Make syscall with SWID=`SYS_isatty'. Reture value `0' stored in $r0 means there is something wrong. */ bnez $r0, 1f /* Branch if success. */ syscall SYS_geterr /* There is something wrong. */ l.w $r15, _impure_ptr swi $r0, [$r15] /* Set errno. */ move $r0, #0 1: ret .size _isatty, .-_isatty #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,601
libgloss/nds32/_chmod.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _chmod, SYS_chmod #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
2,074
libgloss/nds32/_kill.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error. */ .extern _impure_ptr /* The first element is _errno. */ .text .global _kill .type _kill, @function .align 2 _kill: /* A minimal implementation has no concept of either signals, nor of processes to receive those signals. So this function should always fail with an appropriate value in errno. */ movi $r0, #22 /* EINVAL: Invalid argument */ l.w $r15, _impure_ptr swi $r0, [$r15] movi $r0, -1 /* Set return value to -1. */ ret .size _kill, .-_kill
stsp/newlib-ia16
2,040
libgloss/nds32/syscall_error_handler.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __NDS32_VH__ #include "../syscall.h" #include "syscall_extra.h" .extern _impure_ptr /* The first element is _errno. */ .text .global __syscall_error_handler .type __syscall_error_handler, @function .hidden __syscall_error_handler .align 2 __syscall_error_handler: addi $r1, $r0, 1 bnez $r1, 1f /* Branch if success. */ syscall SYS_geterr /* There is something wrong. */ l.w $r15, _impure_ptr swi $r0, [$r15] /* Set errno. */ move $r0, -1 1: ret .size __syscall_error_handler, .-__syscall_error_handler #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,693
libgloss/nds32/_rename.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _rename, VH_RENAME #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _rename, SYS_rename #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,689
libgloss/nds32/_lseek.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _lseek, VH_LSEEK #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _lseek, SYS_lseek #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,811
libgloss/nds32/_gettimeofday.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" TYPE3 _gettimeofday, VH_GETTIMEOFDAY #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" .text .global _gettimeofday .type _gettimeofday, @function .align 2 _gettimeofday: syscall SYS_gettimeofday ret .size _gettimeofday, .-_gettimeofday #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
1,694
libgloss/nds32/_unlink.S
/* Copyright (c) 2013 Andes Technology Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the company may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef __NDS32_VH__ #include "vh.h" .extern _impure_ptr TYPE1 _unlink, VH_UNLINK #else /* not __NDS32_VH__ */ #include "../syscall.h" #include "syscall_extra.h" SYS_WRAPPER _unlink, SYS_unlink #endif /* not __NDS32_VH__ */
stsp/newlib-ia16
2,401
libgloss/lm32/crt0.S
/* * Lattice Mico32 C startup code. * Contributed by Jon Beniston <jon@beniston.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ .section .boot, "ax", @progbits /* Program starts here */ .global _start _start: /* Setup stack and global pointer */ mvhi sp, hi(_fstack) ori sp, sp, lo(_fstack) mvhi gp, hi(_gp) ori gp, gp, lo(_gp) /* Clear BSS */ mvhi r1, hi(_fbss) ori r1, r1, lo(_fbss) mvi r2, 0 mvhi r3, hi(_ebss) ori r3, r3, lo(_ebss) sub r3, r3, r1 calli memset /* Call C++ constructors */ calli _init /* Call C++ destructors on exit */ mvhi r1, hi(_fini) ori r1, r1, lo(_fini) calli atexit /* Call main program */ mvi r1, 0 mvi r2, 0 mvi r3, 0 calli main /* Call exit, which doesn't return, to perform any clean up */ calli exit
stsp/newlib-ia16
3,619
libgloss/lm32/scall.S
/* * Lattice Mico32 system calls. * Contributed by Jon Beniston <jon@beniston.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <syscall.h> /* * System call convention (as implemented in simulator: * - System call number in register r8 * - Return value in r1 and r2 (only if 64-bit value) * - errno in r3 */ .extern errno .global _write _write: mvi r8, SYS_write scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _read _read: mvi r8, SYS_read scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _open _open: mvi r8, SYS_open scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _close _close: mvi r8, SYS_close scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _lseek _lseek: mvi r8, SYS_lseek scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _fstat _fstat: mvi r8, SYS_fstat scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _stat _stat: mvi r8, SYS_stat scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _link _link: mvi r8, SYS_link scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _unlink _unlink: mvi r8, SYS_unlink scall mvhi r4, hi(errno) ori r4, r4, lo(errno) sw (r4+0), r3 ret .global _exit _exit: /* This call doesn't return */ mvi r8, SYS_exit scall
stsp/newlib-ia16
2,801
libgloss/mn10300/crt0_redboot.S
/* * crt0_redboot.S -- Minimal startup file for MN10300 targets running Redboot. * * Copyright (c) 2001 Red Hat, Inc. * Derived from crt0_cygmon.S - Copyright (c) 1995, 1996, 1997, 2000 Red Hat, Inc. * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ /* * This file contains the minimal startup code necessary. * This will not do any hardware initialization. It is assumed that we are talking to Redboot * and therefore the hardware will be initialized properly. */ /* * Set up some room for a stack. We just grab a chunk of memory. */ #define STACK_SIZE 0x4000 #define GLOBAL_SIZE 0x2000 #define STARTUP_STACK_SIZE 0x0100 .comm __memsize, 12 .comm __lstack, STARTUP_STACK_SIZE .comm __stackbase,4 .section .text .global _start _start: /* * Setup a small stack so we can run some C code, * and get the usable memory size. */ mov __lstack,a0 add STARTUP_STACK_SIZE-4,a0 mov a0,sp /* * zero out the bss section. */ .global __memsize .global _get_mem_info zerobss: mov __bss_start, a0 # These variables are defined in the linker script mov _end, a1 cmp a0, a1 # If no bss, then do nothing beq 7f clr d0 3: movbu d0,(a0) # Clear a byte and bump pointer inc a0 cmp a0, a1 bne 3b 7: /* * Setup the stack pointer -- * get_mem_info returns the top of memory, so just use that In * addition, we must subtract 24 bytes for the 3 8 byte * arguments to main, in case main wants to write them back to * the stack. The caller is supposed to allocate stack space * for parameters in registers in the old MIPS ABIs. We must * do this even though we aren't passing arguments, because * main might be declared to have them. * Some ports need a larger alignment for the stack, so we * subtract 32, which satisifes the stack for the arguments and * keeps the stack pointer better aligned. */ mov __memsize, d0 call _get_mem_info,[],0 sub 32, a0 mov a0, sp mov __stackbase, a1 mov a0, (a1) # keep this for future ref call ___main,[],0 # Call __main to run ctors/dtors clr d0 clr d1 mov d0, (4,sp) or 0x0800,psw # Enable interrupts call _main,[],0 # Call main program call _exit,[],0 /* EOF crt0_redboot.S */
stsp/newlib-ia16
1,712
libgloss/mn10300/crt0.S
##============================================================================== ## ## crt0.S ## ## MN10300 startup code ## ##============================================================================== ## ## Copyright (c) 1995, 1996, 1997, 1998 Cygnus Solutions ## ## The authors hereby grant permission to use, copy, modify, distribute, ## and license this software and its documentation for any purpose, provided ## that existing copyright notices are retained in all copies and that this ## notice is included verbatim in any distributions. No written agreement, ## license, or royalty fee is required for any of the authorized uses. ## Modifications to this software may be copyrighted by their authors ## and need not follow the licensing terms described here, provided that ## the new terms are clearly indicated on the first page of each file where ## they apply. ## ##------------------------------------------------------------------------------ .file "crt0.S" ##------------------------------------------------------------------------------ ## Startup code .section .text .global _start _start: mov _stack-8,a0 # Load up the stack pointer mov a0,sp mov _edata,a0 # Get the start/end of bss mov _end,a1 cmp a0,a1 # If no bss, then do nothing beq .L0 clr d0 # clear d0 .L1: movbu d0,(a0) # Clear a byte and bump pointer inc a0 cmp a0,a1 bne .L1 .L0: call ___main,[],0 # Call __main to run ctors/dtors clr d0 clr d1 mov d0,(4,sp) call _main,[],0 # Call main program call _exit,[],0 # All done, no need to return or # deallocate our stack. .section .stack _stack: .long 1 .section .data .global ___dso_handle .weak ___dso_handle ___dso_handle: .long 0
stsp/newlib-ia16
1,810
libgloss/mn10300/crt0-eval.S
##============================================================================== ## ## crt0-eval.S ## ## MN10300 Series Evaluation Board C startup code ## ##============================================================================== ######COPYRIGHTBEGIN#### ## ## Copyright (c) 1995, 1996, 1997, 1998 Cygnus Solutions ## ## The authors hereby grant permission to use, copy, modify, distribute, ## and license this software and its documentation for any purpose, provided ## that existing copyright notices are retained in all copies and that this ## notice is included verbatim in any distributions. No written agreement, ## license, or royalty fee is required for any of the authorized uses. ## Modifications to this software may be copyrighted by their authors ## and need not follow the licensing terms described here, provided that ## the new terms are clearly indicated on the first page of each file where ## they apply. ## ######COPYRIGHTEND#### ##------------------------------------------------------------------------------ .file "crt0-eval.S" ##------------------------------------------------------------------------------ ## Startup code .equ DRAM_TOP,0x48100000 .text .globl __start __start: # Set up stack. Leave 4K at top for use by Cygmon. mov DRAM_TOP - 0x1000,a0 sub 8,a0 mov a0,sp # Clear BSS mov __bss_start,a0 mov _end,a1 cmp a0,a1 beq 8f clr d0 1: movbu d0,(a0) inc a0 cmp a0,a1 bne 1b 8: # Call constructors .extern ___main call ___main,[],0 # Call main clr d0 clr d1 mov d0,(4,sp) 9: or 0x0800,psw # Enable interrupts .extern _main call _main,[],0 .extern __exit call __exit,[],0 # bra 9b # Loop if we return ##------------------------------------------------------------------------------ ## end of crt0-eval.S
stsp/newlib-ia16
2,693
libgloss/mn10300/crt0_cygmon.S
/* * crt0_cygmon.S -- Minimal startup file for MN10300 targets running Cygmon. * * Copyright (c) 1995, 1996, 1997, 2000 Red Hat, Inc. * * The authors hereby grant permission to use, copy, modify, distribute, * and license this software and its documentation for any purpose, provided * that existing copyright notices are retained in all copies and that this * notice is included verbatim in any distributions. No written agreement, * license, or royalty fee is required for any of the authorized uses. * Modifications to this software may be copyrighted by their authors * and need not follow the licensing terms described here, provided that * the new terms are clearly indicated on the first page of each file where * they apply. */ /* * This file contains the minimal startup code necessary. * This will not do any hardware initialization. It is assumed that we are talking to Cygmon * and therefore the hardware will be initialized properly. */ /* * Set up some room for a stack. We just grab a chunk of memory. */ #define STACK_SIZE 0x4000 #define GLOBAL_SIZE 0x2000 #define STARTUP_STACK_SIZE 0x0100 .comm __memsize, 12 .comm __lstack, STARTUP_STACK_SIZE .comm __stackbase,4 .section .text .global _start _start: /* * Setup a small stack so we can run some C code, * and get the usable memory size. */ mov __lstack,a0 add STARTUP_STACK_SIZE-4,a0 mov a0,sp /* * zero out the bss section. */ .global __memsize .global _get_mem_info zerobss: mov __bss_start, a0 # These variables are defined in the linker script mov _end, a1 cmp a0, a1 # If no bss, then do nothing beq 7f clr d0 3: movbu d0,(a0) # Clear a byte and bump pointer inc a0 cmp a0, a1 bne 3b 7: /* * Setup the stack pointer -- * get_mem_info returns the top of memory, so just use that In * addition, we must subtract 24 bytes for the 3 8 byte * arguments to main, in case main wants to write them back to * the stack. The caller is supposed to allocate stack space * for parameters in registers in the old MIPS ABIs. We must * do this even though we aren't passing arguments, because * main might be declared to have them. * Some ports need a larger alignment for the stack, so we * subtract 32, which satisifes the stack for the arguments and * keeps the stack pointer better aligned. */ mov __memsize, d0 call _get_mem_info,[],0 sub 32, a0 mov a0, sp mov __stackbase, a1 mov a0, (a1) # keep this for future ref call ___main,[],0 # Call __main to run ctors/dtors clr d0 clr d1 mov d0, (4,sp) call _main,[],0 # Call main program call _exit,[],0 /* EOF crt0_cygmon.S */
stsp/newlib-ia16
1,512
libgloss/rl78/read.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(read)
stsp/newlib-ia16
1,512
libgloss/rl78/kill.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(kill)
stsp/newlib-ia16
2,252
libgloss/rl78/gcrt0.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the copyright holders and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall Red Hat incorporated be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. */ #define PROFILE_SUPPORT 1 #include "crt0.S" .global __mcount .type __mcount, @function __mcount: ;; When a function is compiled for profiling, gcc creates code ;; like this at the start of each profiled function: ;; ;; .global <func_name> ;; <func_name>: ;; bsr __mcount ;; <...function's prologue...> ;; <...function's body...> ;; ;; We must save all of the argument registers, extract the ;; address of <func_name>, call _mcount_internal to do the ;; real work and then restore the argument registers before ;; returning. movw ax, [sp] push ax call !!__mcount_internal pop ax ret .size __mcount, . - __mcount
stsp/newlib-ia16
1,513
libgloss/rl78/chmod.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(chmod)
stsp/newlib-ia16
1,515
libgloss/rl78/argvlen.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(argvlen)
stsp/newlib-ia16
1,514
libgloss/rl78/unlink.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(unlink)
stsp/newlib-ia16
1,513
libgloss/rl78/times.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(times)
stsp/newlib-ia16
1,513
libgloss/rl78/fstat.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(fstat)
stsp/newlib-ia16
1,512
libgloss/rl78/stat.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(stat)
stsp/newlib-ia16
1,520
libgloss/rl78/gettimeofday.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(gettimeofday)
stsp/newlib-ia16
1,692
libgloss/rl78/crtn.S
/* Copyright (c) 2005,2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ .section .init,"ax" call !!_rl78_run_preinit_array call !!_rl78_run_init_array ret .global __rl78_init_end __rl78_init_end: .section .fini,"ax" ret .global __rl78_fini_end __rl78_fini_end: .text
stsp/newlib-ia16
1,731
libgloss/rl78/abort.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" .global _abort .type _abort, @function _abort: /* This is for debuggers. The simulator stops here too. */ brk movw ax, #42 push ax SYSCALL(SYS_kill) pop ax /* Else, exit. */ call !!__exit .size _abort, . - _abort
stsp/newlib-ia16
1,512
libgloss/rl78/time.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(time)
stsp/newlib-ia16
6,112
libgloss/rl78/crt0.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the copyright holders and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall Red Hat incorporated be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. */ #include "rl78-sys.h" .section ".vec","a" .short _start .section ".ivec","a" .macro _iv x .weak \x .short \x .endm #define IV(x) _iv _##x##_handler #define IVx() .short 0 /* To use a vector, simply define a global function named foo_handler() for any IV(foo) listed below (i.e. tm05_handler) */ .global _interrupt_vector_table _interrupt_vector_table: IV(wdti) IV(lvi) IV(p0) IV(p1) IV(p2) IV(p3) IV(p4) IV(p5) IV(st2) IV(sr2) IV(sre2) IV(dma0) IV(dma1) IV(st0) IV(sr0) IV(tm01h) IV(st1) IV(sr1) IV(sre1) IV(iica0) IV(tm00) IV(tm01) IV(tm02) IV(tm03) IV(ad) IV(rtc) IV(it) IV(kr) IV(st3) IV(sr3) IV(tm13) IV(tm04) IV(tm05) IV(tm06) IV(tm07) IV(p6) IV(p7) IV(p8) IV(p9) IV(p10) IV(p11) IV(tm10) IV(tm12) IV(sre3) IV(tm13h) IV(md) IV(iica1) IV(fl) IV(dma2) IV(dma3) IV(tm14) IV(tm15) IV(tm16) IV(tm17) IVx() IVx() IVx() IVx() IVx() IVx() IVx() IV(brk) /* Note: 126 vectors */ .section ".csstart", "ax" .global __csstart __csstart: br !!_start .weak __rl78_option_byte_0 .weak __rl78_option_byte_1 .weak __rl78_option_byte_2 .weak __rl78_option_byte_3 __rl78_option_byte_0 = 0x6e __rl78_option_byte_1 = 0xff __rl78_option_byte_2 = 0xe8 __rl78_option_byte_3 = 0x85 .section ".opt", "a" .byte __rl78_option_byte_0 .byte __rl78_option_byte_1 .byte __rl78_option_byte_2 .byte __rl78_option_byte_3 .text .global _start .type _start, @function _start: movw sp, #__stack ;; block move to initialize .data mov es, #0 movw bc, #__romdatacopysize 1: movw ax, bc cmpw ax, #0 bz $1f decw bc decw bc movw ax, es:__romdatastart[bc] movw __datastart[bc], ax br $1b 1: mov es, #0 movw bc, #__romsaddrcopysize 1: movw ax, bc cmpw ax, #0 bz $1f decw bc decw bc movw ax, es:__romsaddrstart[bc] movw __saddrstart[bc], ax br $1b 1: ;; block fill to .bss movw bc, #__bsssize movw ax, #0 cmpw ax, bc bz $_bss_zero_done 1: decw bc decw bc movw __bssstart[bc], ax cmpw ax, bc bnz $1b _bss_zero_done: call !!__rl78_init #ifdef PROFILE_SUPPORT /* Defined in gcrt0.S. */ movw ax, # _start push ax movw ax, # _etext push ax call !!__monstartup #endif movw ax, #0 push ax /* envp */ push ax /* argv */ push ax /* argc */ call !!_main .LFE2: movw ax, r8 ; Save return code. push ax #ifdef PROFILE_SUPPORT call !!__mcleanup #endif call !!_exit .size _start, . - _start .global _rl78_run_preinit_array .type _rl78_run_preinit_array,@function _rl78_run_preinit_array: movw hl, #__preinit_array_start movw de, #__preinit_array_end movw bc, #-2 br $_rl78_run_inilist .global _rl78_run_init_array .type _rl78_run_init_array,@function _rl78_run_init_array: movw hl, #__init_array_start movw de, #__init_array_end movw bc, #2 br $_rl78_run_inilist .global _rl78_run_fini_array .type _rl78_run_fini_array,@function _rl78_run_fini_array: movw hl, #__fini_array_start movw de, #__fini_array_end movw bc, #-2 /* fall through */ ;; HL = start of list ;; DE = end of list ;; BC = step direction (+2 or -2) _rl78_run_inilist: next_inilist: movw ax, hl cmpw ax, de bz $done_inilist movw ax, [hl] cmpw ax, #-1 bz $skip_inilist cmpw ax, #0 bz $skip_inilist push ax push bc push de push hl call ax pop hl pop de pop bc pop ax skip_inilist: movw ax, hl addw ax, bc movw hl, ax br $next_inilist done_inilist: ret .section .init,"ax" .global __rl78_init __rl78_init: .section .fini,"ax" .global __rl78_fini __rl78_fini: call !!_rl78_run_fini_array .section .data .global ___dso_handle .weak ___dso_handle ___dso_handle: .long 0 ;;; Provide Dwarf unwinding information that will help GDB stop ;;; backtraces at the right place. This is stolen from assembly ;;; code generated by GCC with -dA. .section .debug_frame,"",@progbits .Lframe0: .4byte .LECIE0-.LSCIE0 ; Length of Common Information Entry .LSCIE0: .4byte 0xffffffff ; CIE Identifier Tag .byte 0x1 ; CIE Version .ascii "\0" ; CIE Augmentation .uleb128 0x1 ; CIE Code Alignment Factor .sleb128 -1 ; CIE Data Alignment Factor .byte 0xd ; CIE RA Column .byte 0xc ; DW_CFA_def_cfa .uleb128 0xc .uleb128 0x3 .byte 0x8d ; DW_CFA_offset, column 0xd .uleb128 0x3 .p2align 2 .LECIE0: .LSFDE0: .4byte .LEFDE0-.LASFDE0 ; FDE Length .LASFDE0: .4byte .Lframe0 ; FDE CIE offset .4byte _start ; FDE initial location .4byte .LFE2 - _start ; FDE address range .byte 0xf ; DW_CFA_def_cfa_expression .uleb128 1 ; length of expression .byte 0x30 ; DW_OP_lit0 .p2align 2 .LEFDE0: .text
stsp/newlib-ia16
1,513
libgloss/rl78/utime.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(utime)
stsp/newlib-ia16
1,512
libgloss/rl78/close.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" OK(close)
stsp/newlib-ia16
1,598
libgloss/rl78/isatty.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" .global _isatty .weak _isatty _isatty: RET(_isatty,1)
stsp/newlib-ia16
1,624
libgloss/rl78/swrite.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" .global __SYS_write .type __SYS_write, @function __SYS_write: SYSCALL(SYS_write) .size __SYS_write, . - __SYS_write
stsp/newlib-ia16
1,513
libgloss/rl78/lseek.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(lseek)
stsp/newlib-ia16
1,512
libgloss/rl78/open.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(open)
stsp/newlib-ia16
1,512
libgloss/rl78/argv.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(argv)
stsp/newlib-ia16
1,519
libgloss/rl78/getpid.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" RET(getpid,42)
stsp/newlib-ia16
1,638
libgloss/rl78/exit.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" .global __exit .type __exit, @function __exit: call !!__rl78_fini mov a, [sp+4] halt SYSCALL(SYS_exit) .size __exit, . - __exit
stsp/newlib-ia16
1,512
libgloss/rl78/link.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(link)
stsp/newlib-ia16
1,513
libgloss/rl78/chdir.S
/* Copyright (c) 2011 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rl78-sys.h" ERR(chdir)
stsp/newlib-ia16
1,507
libgloss/rx/read.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(read)
stsp/newlib-ia16
1,507
libgloss/rx/kill.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(kill)
stsp/newlib-ia16
1,543
libgloss/rx/sigprocmask.S
/* Copyright (c) 2009 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" #define SYS_sigprocmask 127 S(sigprocmask)
stsp/newlib-ia16
1,508
libgloss/rx/chmod.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(chmod)
stsp/newlib-ia16
1,510
libgloss/rx/argvlen.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(argvlen)
stsp/newlib-ia16
1,509
libgloss/rx/unlink.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(unlink)
stsp/newlib-ia16
1,543
libgloss/rx/heaptop.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" #define SYS__set_heaptop 11 S(_set_heaptop)
stsp/newlib-ia16
1,508
libgloss/rx/times.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(times)
stsp/newlib-ia16
1,532
libgloss/rx/sleep.S
/* Copyright (c) 2009 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" #define SYS_sleep 127 S(sleep)
stsp/newlib-ia16
1,508
libgloss/rx/fstat.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(fstat)
stsp/newlib-ia16
1,507
libgloss/rx/stat.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(stat)
stsp/newlib-ia16
1,515
libgloss/rx/gettimeofday.S
/* Copyright (c) 2005 Red Hat Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of Red Hat Incorporated may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "rxsys.h" S(gettimeofday)