1 #ident "$Id: memdisk.h,v 1.9 2005/03/08 18:39:32 hpa Exp $"
2 /* ----------------------------------------------------------------------- *
4 * Copyright 2001-2003 H. Peter Anvin - All Rights Reserved
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 * Boston MA 02111-1307, USA; either version 2 of the License, or
10 * (at your option) any later version; incorporated herein by reference.
12 * ----------------------------------------------------------------------- */
17 * Miscellaneous header definitions
23 /* We use the com32 interface for calling 16-bit code */
26 /* The real-mode segment */
27 #define LOW_SEG 0x0800
29 typedef void (*syscall_t)(uint8_t, com32sys_t *, com32sys_t *);
30 extern syscall_t syscall;
31 extern void *sys_bounce;
33 /* What to call when we're dead */
34 extern void __attribute__((noreturn)) die(void);
36 /* Standard routines */
37 #define memcpy(a,b,c) __builtin_memcpy(a,b,c)
38 #define memset(a,b,c) __builtin_memset(a,b,c)
39 #define strcpy(a,b) __builtin_strcpy(a,b)
40 #define strlen(a) __builtin_strlen(a)
42 /* memcpy() but returns a pointer to end of buffer */
44 memcpy_endptr(void *__d, const void *__s, unsigned int __n)
46 memcpy(__d, __s, __n);
47 return (void *)((char *)__d + __n);
52 memcmp(const void *__a, const void *__b, unsigned int __n)
54 const unsigned char *__aa = __a;
55 const unsigned char *__bb = __b;
59 __d = *__bb++ - *__aa++;
68 extern int check_zip(void *indata, uint32_t size, uint32_t *zbytes_p,
69 uint32_t *dbytes_p, uint32_t *orig_crc,
71 extern void *unzip(void *indata, uint32_t zbytes, uint32_t dbytes,
72 uint32_t orig_crc, void *target);