1 /* ----------------------------------------------------------------------- *
3 * Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 * Miscellaneous header definitions
22 /* We use the com32 interface for calling 16-bit code */
25 /* The real-mode segment */
26 #define LOW_SEG 0x0800
28 typedef void (*syscall_t
)(uint8_t, com32sys_t
*, com32sys_t
*);
29 extern syscall_t syscall
;
30 extern void *sys_bounce
;
32 /* What to call when we're dead */
33 extern void __attribute__((noreturn
)) die(void);
35 /* Standard routines */
36 #define memcpy(a,b,c) __builtin_memcpy(a,b,c)
37 #define memset(a,b,c) __builtin_memset(a,b,c)
38 #define strcpy(a,b) __builtin_strcpy(a,b)
39 #define strlen(a) __builtin_strlen(a)
41 /* memcpy() but returns a pointer to end of buffer */
43 memcpy_endptr(void *__d
, const void *__s
, unsigned int __n
)
45 memcpy(__d
, __s
, __n
);
46 return (void *)((char *)__d
+ __n
);
51 memcmp(const void *__a
, const void *__b
, unsigned int __n
)
53 const unsigned char *__aa
= __a
;
54 const unsigned char *__bb
= __b
;
58 __d
= *__bb
++ - *__aa
++;
67 extern int check_zip(void *indata
, uint32_t size
, uint32_t *zbytes_p
,
68 uint32_t *dbytes_p
, uint32_t *orig_crc
,
70 extern void *unzip(void *indata
, uint32_t zbytes
, uint32_t dbytes
,
71 uint32_t orig_crc
, void *target
);