Next in my series of cleanups form the alpha port nothing should break yet...

This commit is contained in:
Eric W. Biederman 2001-03-23 21:03:13 +00:00
commit 24fe8d03aa
28 changed files with 1672 additions and 143 deletions

View file

@ -4,6 +4,7 @@
/* Standard ELF types. */
#include <stdint.h>
#include <stddef.h>
#include <arch/boot/boot.h>
/* Type for a 16-bit quantity. */
@ -390,4 +391,5 @@ typedef Elf64_Phdr Elf_phdr;
extern int elf_check_arch(Elf_ehdr *ehdr);
extern void jmp_to_elf_entry(void *entry, void *ube);
extern int elfboot(size_t totalram);
#endif /* elf.h */

View file

@ -0,0 +1,13 @@
#ifndef ROM_FILL_INBUF_H
#define ROM_FILL_INBUF_H
extern unsigned char *inbuf; /* input buffer */
extern unsigned int insize; /* valid bytes in inbuf */
extern unsigned int inptr; /* index of next byte to be processed in inbuf */
extern int fill_inbuf(void);
#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
#endif /* ROM_FILL_INBUF_H */

View file

@ -6,4 +6,9 @@
extern void *malloc(size_t size);
void free(void *ptr);
/* Extensions to malloc... */
typedef size_t malloc_mark_t;
void malloc_mark(malloc_mark_t *place);
void malloc_release(malloc_mark_t *place);
#endif /* STDLIB_H */

View file

@ -1,3 +1,8 @@
#ifndef STRING_H
#define STRING_H
#include <stddef.h>
// yes, linux has fancy ones. We don't care. This stuff gets used
// hardly at all. And the pain of including those files is just too high.
@ -5,8 +10,7 @@
//extern inline int strlen(char *src) { int i = 0; while (*src++) i++; return i;}
#if 1
extern inline int strnlen(const char *src, int max) {
static inline size_t strnlen(const char *src, size_t max) {
int i = 0;
if (max<0) {
while (*src++)
@ -19,23 +23,9 @@ extern inline int strnlen(const char *src, int max) {
return i;
}
}
#else
static inline size_t strnlen(const char * s, size_t count)
{
int d0;
register int __res;
__asm__ __volatile__(
"movl %2,%0\n\t"
"jmp 2f\n"
"1:\tcmpb $0,(%0)\n\t"
"je 3f\n\t"
"incl %0\n"
"2:\tdecl %1\n\t"
"cmpl $-1,%1\n\t"
"jne 1b\n"
"3:\tsubl %2,%0"
:"=a" (__res), "=&d" (d0)
:"c" (s),"1" (count));
return __res;
}
#endif
extern void *memcpy(void *dest, const void *src, size_t n);
extern void *memset(void *s, int c, size_t n);
extern int memcmp(const void *s1, const void *s2, size_t n);
#endif /* STRING_H */