ia64/xen-unstable

view extras/mini-os/include/arch/cc.h @ 17042:a905c582a406

Add stubdomain support. See stubdom/README for usage details.

- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in
arch_limits.h so as to permit getting them from there without
pulling all the internal Mini-OS defines.
- Setup a xen-elf cross-compilation environment in stubdom/cross-root
- Add a POSIX layer on top of Mini-OS by linking against the newlib C
library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c
- Cross-compile zlib and libpci too.
- Add an xs.h-compatible layer on top of Mini-OS' xenbus.
- Cross-compile libxc with an additional xc_minios.c and a few things
disabled.
- Cross-compile ioemu with an additional block-vbd, but without sound,
tpm and other details. A few hacks are needed:
- Align ide and scsi buffers at least on sector size to permit
direct transmission to the block backend. While we are at it, just
page-align it to possibly save a segment. Also, limit the scsi
buffer size because of limitations of the block paravirtualization
protocol.
- Allocate big tables dynamically rather that letting them go to
bss: when Mini-OS gets installed in memory, bss is not lazily
allocated, and doing so during Mini-OS is unnecessarily trick while
we can simply use malloc.
- Had to change the Mini-OS compilation somehow, so as to export
Mini-OS compilation flags to the Makefiles of libxc and ioemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 12 14:35:39 2008 +0000 (2008-02-12)
parents 3c49ae5641b0
children aadde6652457
line source
1 /*
2 * lwip/arch/cc.h
3 *
4 * Compiler-specific types and macros for lwIP running on mini-os
5 *
6 * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
7 */
9 #ifndef __LWIP_ARCH_CC_H__
10 #define __LWIP_ARCH_CC_H__
12 /* Typedefs for the types used by lwip - */
13 #include <os.h>
14 #include <types.h>
15 #include <time.h>
16 typedef u8 u8_t;
17 typedef s8 s8_t;
18 typedef u16 u16_t;
19 typedef s16 s16_t;
20 typedef u32 u32_t;
21 typedef s32 s32_t;
22 typedef u64 u64_t;
23 typedef s64 s64_t;
24 typedef uintptr_t mem_ptr_t;
26 typedef u16 u_short;
28 /* Compiler hints for packing lwip's structures - */
29 #define PACK_STRUCT_FIELD(_x) _x
30 #define PACK_STRUCT_STRUCT __attribute__ ((packed))
31 #define PACK_STRUCT_BEGIN
32 #define PACK_STRUCT_END
34 /* Platform specific diagnostic output - */
36 extern void lwip_printk(char *fmt, ...);
37 #define LWIP_PLATFORM_DIAG(_x) do { lwip_printk _x ; } while (0)
39 extern void lwip_die(char *fmt, ...);
40 #define LWIP_PLATFORM_ASSERT(_x) do { lwip_die(_x); } while(0)
42 /* "lightweight" synchronization mechanisms - */
43 /* SYS_ARCH_DECL_PROTECT(x) - declare a protection state variable. */
44 /* SYS_ARCH_PROTECT(x) - enter protection mode. */
45 /* SYS_ARCH_UNPROTECT(x) - leave protection mode. */
47 /* If the compiler does not provide memset() this file must include a */
48 /* definition of it, or include a file which defines it. */
49 #include <lib.h>
51 /* This file must either include a system-local <errno.h> which defines */
52 /* the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO */
53 /* to make lwip/arch.h define the codes which are used throughout. */
54 #include <errno.h>
56 /* Not required by the docs, but needed for network-order calculations */
57 #ifdef HAVE_LIBC
58 #include <machine/endian.h>
59 #ifndef BIG_ENDIAN
60 #error endian.h does not define byte order
61 #endif
62 #else
63 #include <endian.h>
64 #endif
66 #include <inttypes.h>
67 #define S16_F PRIi16
68 #define U16_F PRIu16
69 #define X16_F PRIx16
70 #define S32_F PRIi32
71 #define U32_F PRIu32
72 #define X32_F PRIx32
74 #if 0
75 #ifndef DBG_ON
76 #define DBG_ON LWIP_DBG_ON
77 #endif
78 #define LWIP_DEBUG DBG_ON
79 //#define IP_DEBUG DBG_ON
80 #define TCP_DEBUG DBG_ON
81 #define TCP_INPUT_DEBUG DBG_ON
82 #define TCP_QLEN_DEBUG DBG_ON
83 #define TCPIP_DEBUG DBG_ON
84 #define DBG_TYPES_ON DBG_ON
85 #endif
87 /* TODO: checksum doesn't work fine?! */
88 #define CHECKSUM_CHECK_TCP 0
90 #endif /* __LWIP_ARCH_CC_H__ */