ia64/xen-unstable

view extras/mini-os/include/fs.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 d5e22e766d1f
children 707e10c9a487
line source
1 #ifndef __FS_H__
2 #define __FS_H__
4 #include <xen/io/fsif.h>
5 #include <semaphore.h>
6 #include <types.h>
8 struct fs_import
9 {
10 domid_t dom_id; /* dom id of the exporting domain */
11 u16 export_id; /* export id (exporting dom specific) */
12 u16 import_id; /* import id (specific to this domain) */
13 struct list_head list; /* list of all imports */
14 unsigned int nr_entries; /* Number of entries in rings & request
15 array */
16 struct fsif_front_ring ring; /* frontend ring (contains shared ring) */
17 int gnt_ref; /* grant reference to the shared ring */
18 evtchn_port_t local_port; /* local event channel port */
19 char *backend; /* XenBus location of the backend */
20 struct fs_request *requests; /* Table of requests */
21 unsigned short *freelist; /* List of free request ids */
22 struct semaphore reqs_sem; /* Accounts requests resource */
23 };
25 extern struct fs_import *fs_import;
27 void init_fs_frontend(void);
29 int fs_open(struct fs_import *import, char *file);
30 int fs_close(struct fs_import *import, int fd);
31 ssize_t fs_read(struct fs_import *import, int fd, void *buf,
32 ssize_t len, ssize_t offset);
33 ssize_t fs_write(struct fs_import *import, int fd, void *buf,
34 ssize_t len, ssize_t offset);
35 int fs_stat(struct fs_import *import,
36 int fd,
37 struct fsif_stat_response *stat);
38 int fs_truncate(struct fs_import *import,
39 int fd,
40 int64_t length);
41 int fs_remove(struct fs_import *import, char *file);
42 int fs_rename(struct fs_import *import,
43 char *old_file_name,
44 char *new_file_name);
45 int fs_create(struct fs_import *import, char *name,
46 int8_t directory, int32_t mode);
47 char** fs_list(struct fs_import *import, char *name,
48 int32_t offset, int32_t *nr_files, int *has_more);
49 int fs_chmod(struct fs_import *import, int fd, int32_t mode);
50 int64_t fs_space(struct fs_import *import, char *location);
51 int fs_sync(struct fs_import *import, int fd);
53 #endif