added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / kernel / exec / startup.h
blob25317af1a52de88af0b73338b88b28328d1e7854
1 #ifndef _STARTUP_H
2 #define _STARTUP_H
4 #include <exec/types.h>
5 #include <asm/macros.h>
7 /* external data definitions */
9 extern const UBYTE core_id[];
10 extern const UBYTE _END;
12 extern const UBYTE Exec_Start;
13 extern const UBYTE Exec_End;
15 extern const ULONG ExecFunctions[];
17 /* external function definitions */
19 void startup(void);
20 ULONG ** RomTagScanner(struct ExecBase *, UWORD **);
22 /* inlined functions taken from c library, needed by bootup */
24 static inline __attribute__((always_inline))
25 char *strncpy(char *dest, const char *src, ULONG n)
27 char *ret = dest;
28 while(n--)
30 *dest++ = *src++;
31 if (*src == 0)
32 break;
34 return ret;
37 static inline __attribute__((always_inline))
38 APTR memcpy(APTR dest, APTR src, ULONG n)
40 while(n--)
42 ((UBYTE*)dest)[n] = ((UBYTE*)src)[n];
46 static inline __attribute__((always_inline))
47 void bzero(APTR s, ULONG n)
49 while(n--)
50 ((UBYTE*)s)[n] = 0;
53 #define offsetof(struct_, field) ((int)(&((struct struct_*)0UL)->field))
55 #endif /* _STARTUP_H */