static int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
+ int r;
+
init_acpi();
+ /* Let SEF know about ACPI special cache word. */
+ r = sef_llvm_add_special_mem_region((void*)0xCACACACA, 1,
+ "%MMAP_CACHE_WORD");
+ if(r < 0) {
+ printf("acpi: sef_llvm_add_special_mem_region failed %d\n", r);
+ }
+
+ /* XXX To-do: acpi requires custom state transfer handlers for
+ * unions acpi_operand_object and acpi_generic_state (and nested unions)
+ * for generic state transfer to work correctly.
+ */
+
return OK;
}
#include "clean.h"
-union fsdata_u {
+union ixfer_fsdata_u {
char b__data[1]; /* ordinary user data */
struct direct b__dir[1]; /* directory block */
zone_t b__v2_ind[1]; /* V2 indirect block */
};
/* These defs make it possible to use to bp->b_data instead of bp->b.b__data */
-#define b_data(b) ((union fsdata_u *) b->data)->b__data
-#define b_dir(b) ((union fsdata_u *) b->data)->b__dir
-#define b_v2_ind(b) ((union fsdata_u *) b->data)->b__v2_ind
-#define b_v2_ino(b) ((union fsdata_u *) b->data)->b__v2_ino
-#define b_bitmap(b) ((union fsdata_u *) b->data)->b__bitmap
+#define b_data(b) ((union ixfer_fsdata_u *) b->data)->b__data
+#define b_dir(b) ((union ixfer_fsdata_u *) b->data)->b__dir
+#define b_v2_ind(b) ((union ixfer_fsdata_u *) b->data)->b__v2_ind
+#define b_v2_ino(b) ((union ixfer_fsdata_u *) b->data)->b__v2_ino
+#define b_bitmap(b) ((union ixfer_fsdata_u *) b->data)->b__bitmap
#endif
*/
int main(void)
{
- struct inode_stat stat;
+ static struct inode_stat stat;
int r;
/*
#include "inc.h"
-struct proc proc[NR_PROCS + NR_TASKS];
-struct mproc mproc[NR_PROCS];
-struct fproc fproc[NR_PROCS];
+typedef struct proc ixfer_proc_t;
+typedef struct fproc ixfer_fproc_t;
+typedef struct mproc ixfer_mproc_t;
+
+ixfer_proc_t proc[NR_PROCS + NR_TASKS];
+ixfer_mproc_t mproc[NR_PROCS];
+ixfer_fproc_t fproc[NR_PROCS];
static int nr_pid_entries;
#endif
#endif
+#ifndef _MINIX_MAGIC
+#define __ALIGNED(X) __aligned(X)
+#else
+#define __ALIGNED(X)
+#endif
+
#define EXTERN extern /* used in *.h files */
#define TRUE 1 /* used for turning integers into Booleans */
} mess_vmmcp_reply;
_ASSERT_MSG_SIZE(mess_vmmcp_reply);
-typedef struct {
+typedef struct noxfer_message {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
union {
u8_t size[56]; /* message payload may have 56 bytes at most */
};
-} message __aligned(16);
+} message __ALIGNED(16);
/* Ensure the complete union respects the IPC assumptions. */
typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ? 1 : -1];
typedef struct {
int cp_flags; /* CPF_* below */
- union {
+ union ixfer_cp_u{
struct {
/* CPF_DIRECT */
endpoint_t cp_who_to; /* grantee */
struct minix_timer;
typedef void (*tmr_func_t)(struct minix_timer *tp);
-typedef union { int ta_int; long ta_long; void *ta_ptr; } tmr_arg_t;
+typedef union { int ta_int; long ta_long; void *ta_ptr; } ixfer_tmr_arg_t;
/* A minix_timer_t variable must be declare for each distinct timer to be used.
* The timers watchdog function and expiration time are automatically set
struct minix_timer *tmr_next; /* next in a timer chain */
clock_t tmr_exp_time; /* expiration time */
tmr_func_t tmr_func; /* function to call when expired */
- tmr_arg_t tmr_arg; /* random argument */
+ ixfer_tmr_arg_t tmr_arg; /* random argument */
} minix_timer_t;
/* Used when the timer is not active. */
#define VMSTYPE_MAP 3
int type; /* suspended operation */
- union {
+ union ixfer_saved{
/* VMSTYPE_SYS_MESSAGE */
message reqmsg; /* suspended request message */
} saved;
/* Parameters of request to VM */
int req_type;
endpoint_t target;
- union {
+ union ixfer_params{
struct {
vir_bytes start, length; /* memory range */
u8_t writeflag; /* nonzero for write access */
ether_addr_t a46_dstaddr;
ether_addr_t a46_srcaddr;
ether_type_t a46_ethtype;
- union
+ union ixfer_arp46_u
{
struct
{
struct event;
-typedef union ev_arg
+typedef struct ev_arg
{
- int ev_int;
void *ev_ptr;
} ev_arg_t;
-typedef void (*ev_func_t) ARGS(( struct event *ev, union ev_arg eva ));
+typedef void (*ev_func_t) ARGS(( struct event *ev, ev_arg_t eva ));
typedef struct event
{
ip_port->ip_dl_type= icp->ic_devtype;
ip_port->ip_mtu= IP_DEF_MTU;
ip_port->ip_mtu_max= IP_MAX_PACKSIZE;
+ memset(&ip_port->ip_dl, 0, sizeof(ip_port->ip_dl));
switch(ip_port->ip_dl_type)
{
{
int ip_flags, ip_dl_type;
int ip_port;
- union
+ union sxfer_ip_dl_u
{
struct
{
} dl_eth;
struct
{
+ int dummy_int[3];
int ps_port;
acc_t *ps_send_head;
acc_t *ps_send_tail;
+ void* dummy_ptr[3];
} dl_ps;
} ip_dl;
ipaddr_t ip_ipaddr;
char *defname;
mode_t mode;
u8_t minor_off;
- } devlist[] = {
+ } devlist[5] = {
{ (char *) "/dev/eth", 0600, ETH_DEV_OFF },
{ (char *) "/dev/psip", 0600, PSIP_DEV_OFF },
{ (char *) "/dev/ip", 0600, IP_DEV_OFF },
{
/* Allocate memory on the heap with sbrk(). */
- return malloc(size);
+ void *addr = malloc(size);
+ memset(addr, 0, size);
+ return addr;
}
/*
int main (int argc, char* argv[])
{
- struct fs_hooks hooks;
- struct inode_stat root_stat;
+ static struct fs_hooks hooks;
+ static struct inode_stat root_stat;
/* fill in the hooks */
memset(&hooks, 0, sizeof(hooks));
char key[DS_MAX_KEYLEN]; /* key to lookup information */
char owner[DS_MAX_KEYLEN];
- union {
+ union dsi_u {
unsigned u32;
- struct {
+ struct dsi_mem {
void *data;
size_t length;
size_t reallen;
#define LINES 22
-static struct data_store ds_store[NR_DS_KEYS];
+static struct data_store noxfer_ds_store[NR_DS_KEYS];
void data_store_dmp()
{
static int prev_i = 0;
int i, n = 0;
- if (getsysinfo(DS_PROC_NR, SI_DATA_STORE, ds_store, sizeof(ds_store)) != OK) {
+ if (getsysinfo(DS_PROC_NR, SI_DATA_STORE, noxfer_ds_store, sizeof(noxfer_ds_store)) != OK) {
printf("Error obtaining table from DS. Perhaps recompile IS?\n");
return;
}
printf("Data store contents:\n");
printf("-slot- -----------key----------- -----owner----- ---type--- ----value---\n");
for(i = prev_i; i < NR_DS_KEYS && n < LINES; i++) {
- p = &ds_store[i];
+ p = &noxfer_ds_store[i];
if(!(p->flags & DSF_IN_USE))
continue;
};
/* Definition of an entry of the system process table. */
+typedef struct priv ixfer_priv_s;
struct rproc {
struct rprocpub *r_pub; /* pointer to the corresponding public entry */
struct rproc *r_old_rp; /* pointer to the slot with the old version */
char *r_exec; /* Executable image */
size_t r_exec_len; /* Length of image */
- struct priv r_priv; /* Privilege structure to be passed to the
+ ixfer_priv_s r_priv; /* Privilege structure to be passed to the
* kernel.
*/
uid_t r_uid;
#include <sys/select.h>
#include <minix/safecopies.h>
+#include <minix/sef.h>
/* This is the per-process information. A slot is reserved for each potential
* process. Thus NR_PROCS must be the same as in the kernel. It is not
#define FROM_PROC 0
#define TO_PROC 1
+typedef fd_set *ixfer_fd_set_ptr;
+
static struct selectentry {
struct fproc *requestor; /* slot is free iff this is NULL */
endpoint_t req_endpt;
fd_set readfds, writefds, errorfds;
fd_set ready_readfds, ready_writefds, ready_errorfds;
- fd_set *vir_readfds, *vir_writefds, *vir_errorfds;
+ ixfer_fd_set_ptr vir_readfds, vir_writefds, vir_errorfds;
struct filp *filps[OPEN_MAX];
int type[OPEN_MAX];
int nfds, nreadyfds;
/* Find a space in the virtual address space of VM. */
u32_t curv;
int pde = 0, try_restart;
- static u32_t lastv = 0;
+ static void *lastv = 0;
pt_t *pt = &vmprocess->vm_pt;
vir_bytes vmin, vmax;
u32_t holev = NO_MEM;
assert((vmax % VM_PAGE_SIZE) == 0);
assert(pages > 0);
- curv = lastv;
+ curv = (u32_t) lastv;
if(curv < vmin || curv >= vmax)
curv = vmin;
/* if it's big enough, return it */
if(holesize == pages) {
- lastv = curv + VM_PAGE_SIZE;
+ lastv = (void*) (curv + VM_PAGE_SIZE);
return holev;
}
}
#define JUNK 0xdeadbeef
#define NOJUNK 0xc0ffee
+struct slabdata {
+ u8_t data[DATABYTES];
+ struct sdh sdh;
+};
+
static struct slabheader {
- struct slabdata {
- u8_t data[DATABYTES];
- struct sdh sdh;
- } *list_head;
+ struct slabdata *list_head;
} slabs[SLABSIZES];
static int objstats(void *, int, struct slabheader **, struct slabdata