summaryrefslogtreecommitdiff
path: root/libc-parts
diff options
context:
space:
mode:
Diffstat (limited to 'libc-parts')
-rw-r--r--libc-parts/_exit.c14
-rw-r--r--libc-parts/ia32-cmain.c2
-rw-r--r--libc-parts/process-spawn.c290
-rw-r--r--libc-parts/process-spawn.h10
-rw-r--r--libc-parts/s_printf.c2
5 files changed, 159 insertions, 159 deletions
diff --git a/libc-parts/_exit.c b/libc-parts/_exit.c
index 47ff758..bda719f 100644
--- a/libc-parts/_exit.c
+++ b/libc-parts/_exit.c
@@ -40,7 +40,7 @@ _exit (int ret)
/* We try to kill the activity and, if that fails, the main
thread. */
- addr_t objs[] = { __hurd_startup_data->activity,
+ vg_addr_t objs[] = { __hurd_startup_data->activity,
__hurd_startup_data->thread };
int o;
@@ -50,19 +50,19 @@ _exit (int ret)
for (i = 0; i < __hurd_startup_data->desc_count; i ++)
{
struct hurd_object_desc *desc = &__hurd_startup_data->descs[i];
- if (ADDR_EQ (desc->object, objs[o]))
+ if (VG_ADDR_EQ (desc->object, objs[o]))
{
- if (ADDR_IS_VOID (desc->storage))
+ if (VG_ADDR_IS_VOID (desc->storage))
/* We don't own the storage and thus can't deallocate
the object. */
continue;
- addr_t folio = addr_chop (desc->storage, FOLIO_OBJECTS_LOG2);
- int index = addr_extract (desc->storage, FOLIO_OBJECTS_LOG2);
+ vg_addr_t folio = vg_addr_chop (desc->storage, VG_FOLIO_OBJECTS_LOG2);
+ int index = vg_addr_extract (desc->storage, VG_FOLIO_OBJECTS_LOG2);
error_t err;
- err = rm_folio_object_alloc (ADDR_VOID, folio, index,
- cap_void, OBJECT_POLICY_VOID,
+ err = rm_folio_object_alloc (VG_ADDR_VOID, folio, index,
+ vg_cap_void, VG_OBJECT_POLICY_VOID,
(uintptr_t) ret,
NULL, NULL);
if (err)
diff --git a/libc-parts/ia32-cmain.c b/libc-parts/ia32-cmain.c
index 3f3fd2f..10390f6 100644
--- a/libc-parts/ia32-cmain.c
+++ b/libc-parts/ia32-cmain.c
@@ -66,7 +66,7 @@ finish (void)
i < __hurd_startup_data->desc_count;
i ++, desc ++)
{
- if (ADDR_EQ (PTR_TO_PAGE (p), desc->object))
+ if (VG_ADDR_EQ (VG_PTR_TO_PAGE (p), desc->object))
{
storage_free (desc->storage, true);
break;
diff --git a/libc-parts/process-spawn.c b/libc-parts/process-spawn.c
index 843da21..23a44dc 100644
--- a/libc-parts/process-spawn.c
+++ b/libc-parts/process-spawn.c
@@ -56,13 +56,13 @@
#ifdef RM_INTERN
#include "../viengoos/activity.h"
#else
-#define root_activity ADDR_VOID
+#define root_activity VG_ADDR_VOID
#endif
#ifdef RM_INTERN
# define AS_DUMP_ as_dump_from (root_activity, as_root_cap, __func__)
#else
-# define AS_DUMP_ rm_as_dump (ADDR_VOID, as_root)
+# define AS_DUMP_ rm_as_dump (VG_ADDR_VOID, as_root)
#endif
#define AS_DUMP \
do \
@@ -73,14 +73,14 @@
while (0) \
#ifdef RM_INTERN
-# define rt_to_object(rt) cap_to_object (root_activity, &(rt).cap)
+# define rt_to_object(rt) vg_cap_to_object (root_activity, &(rt).cap)
#else
# define rt_to_object(rt) \
- ADDR_TO_PTR (addr_extend ((rt).storage, 0, PAGESIZE_LOG2))
+ VG_ADDR_TO_PTR (vg_addr_extend ((rt).storage, 0, PAGESIZE_LOG2))
#endif
-thread_t
-process_spawn (addr_t activity,
+vg_thread_t
+process_spawn (vg_addr_t activity,
void *start, void *end,
const char *const argv[], const char *const env[],
bool make_runnable)
@@ -95,18 +95,18 @@ process_spawn (addr_t activity,
sroot_, scap_, saddr_, \
alloc_, index_) \
({ \
- debug (5, "Copying " ADDR_FMT " to " ADDR_FMT , \
- ADDR_PRINTF (saddr_), ADDR_PRINTF (taddr_)); \
+ debug (5, "Copying " VG_ADDR_FMT " to " VG_ADDR_FMT , \
+ VG_ADDR_PRINTF (saddr_), VG_ADDR_PRINTF (taddr_)); \
as_insert_full (root_activity, \
- ADDR_VOID, as_root_cap_, taddr_, \
- ADDR_VOID, ADDR_VOID, scap_, alloc_); \
+ VG_ADDR_VOID, as_root_cap_, taddr_, \
+ VG_ADDR_VOID, VG_ADDR_VOID, scap_, alloc_); \
})
#else
struct shadow
{
- addr_t addr;
- struct cap cap;
+ vg_addr_t addr;
+ struct vg_cap cap;
struct shadow *next;
};
struct shadow *shadow_list = NULL;
@@ -114,9 +114,9 @@ process_spawn (addr_t activity,
struct hurd_ihash as;
hurd_ihash_init (&as, true, HURD_IHASH_NO_LOCP);
- struct cap *add_shadow (addr_t addr)
+ struct vg_cap *add_shadow (vg_addr_t addr)
{
- debug (5, ADDR_FMT, ADDR_PRINTF (addr));
+ debug (5, VG_ADDR_FMT, VG_ADDR_PRINTF (addr));
struct shadow *s = calloc (sizeof (struct shadow), 1);
s->next = shadow_list;
@@ -141,37 +141,37 @@ process_spawn (addr_t activity,
bind them to the page table. That is, if there is a page table
at X, and we index it, we don't refer to X but simply extend its
address and return the shadow pte at that address. */
- struct cap *do_index (activity_t activity,
- struct cap *pt, addr_t pt_addr, int idx,
- struct cap *fake_slot)
+ struct vg_cap *do_index (activity_t activity,
+ struct vg_cap *pt, vg_addr_t pt_addr, int idx,
+ struct vg_cap *fake_slot)
{
- assert (pt->type == cap_cappage || pt->type == cap_rcappage
- || pt->type == cap_folio);
+ assert (pt->type == vg_cap_cappage || pt->type == vg_cap_rcappage
+ || pt->type == vg_cap_folio);
- debug (5, "-> " ADDR_FMT "[%d/%d], %s",
- ADDR_PRINTF (pt_addr), idx, CAPPAGE_SLOTS / CAP_SUBPAGES (pt),
- cap_type_string (pt->type));
+ debug (5, "-> " VG_ADDR_FMT "[%d/%d], %s",
+ VG_ADDR_PRINTF (pt_addr), idx, VG_CAPPAGE_SLOTS / VG_CAP_SUBPAGES (pt),
+ vg_cap_type_string (pt->type));
- addr_t pte_addr;
+ vg_addr_t pte_addr;
switch (pt->type)
{
- case cap_cappage:
- case cap_rcappage:
- pte_addr = addr_extend (pt_addr, idx, CAP_SUBPAGE_SIZE_LOG2 (pt));
+ case vg_cap_cappage:
+ case vg_cap_rcappage:
+ pte_addr = vg_addr_extend (pt_addr, idx, VG_CAP_SUBPAGE_SIZE_LOG2 (pt));
break;
- case cap_folio:
- pte_addr = addr_extend (pt_addr, idx, FOLIO_OBJECTS_LOG2);
+ case vg_cap_folio:
+ pte_addr = vg_addr_extend (pt_addr, idx, VG_FOLIO_OBJECTS_LOG2);
break;
default:
panic ("Expected cappage or folio but got a %s",
- cap_type_string (pt->type));
+ vg_cap_type_string (pt->type));
}
struct shadow *s = hurd_ihash_find (&as, pte_addr.raw);
- struct cap *cap;
+ struct vg_cap *cap;
if (s)
{
- assert (ADDR_EQ (s->addr, pte_addr));
+ assert (VG_ADDR_EQ (s->addr, pte_addr));
cap = &s->cap;
}
else
@@ -180,11 +180,11 @@ process_spawn (addr_t activity,
assert (cap);
- debug (5, "<- " ADDR_FMT "[%d], %s",
- ADDR_PRINTF (pte_addr), CAPPAGE_SLOTS / CAP_SUBPAGES (cap),
- cap_type_string (cap->type));
+ debug (5, "<- " VG_ADDR_FMT "[%d], %s",
+ VG_ADDR_PRINTF (pte_addr), VG_CAPPAGE_SLOTS / VG_CAP_SUBPAGES (cap),
+ vg_cap_type_string (cap->type));
- if (pt->type == cap_folio)
+ if (pt->type == vg_cap_folio)
{
*fake_slot = *cap;
return fake_slot;
@@ -284,33 +284,33 @@ process_spawn (addr_t activity,
/* Root of new address space. */
#ifdef RM_INTERN
-# define as_root ADDR_VOID
- struct cap as_root_cap;
+# define as_root VG_ADDR_VOID
+ struct vg_cap as_root_cap;
memset (&as_root_cap, 0, sizeof (as_root_cap));
# define as_root_cap (&as_root_cap)
#else
- addr_t as_root = capalloc ();
- struct cap *as_root_cap = add_shadow (ADDR (0, 0));
+ vg_addr_t as_root = capalloc ();
+ struct vg_cap *as_root_cap = add_shadow (VG_ADDR (0, 0));
/* This is sort of a hack. To copy a capability, we need to invoke
the source object that contains the capability. A capability
slot is not an object. Finding the object corresponding to
AS_ROOT is possible, but iterposing a thread is just easier. */
struct storage thread_root
- = storage_alloc (ADDR_VOID, cap_thread, STORAGE_EPHEMERAL,
- OBJECT_POLICY_DEFAULT, as_root);
+ = storage_alloc (VG_ADDR_VOID, vg_cap_thread, STORAGE_EPHEMERAL,
+ VG_OBJECT_POLICY_DEFAULT, as_root);
#endif
/* Allocation support. */
/* Address of first folio in new task. */
-#define FOLIO_START (1ULL << (FOLIO_OBJECTS_LOG2 + PAGESIZE_LOG2))
+#define FOLIO_START (1ULL << (VG_FOLIO_OBJECTS_LOG2 + PAGESIZE_LOG2))
bool have_folio = false;
/* Local address. */
- folio_t folio_local_addr;
+ vg_folio_t folio_local_addr;
/* Address in task. */
- addr_t folio_task_addr;
+ vg_addr_t folio_task_addr;
/* Next unallocated object in folio. */
int folio_index;
@@ -318,43 +318,43 @@ process_spawn (addr_t activity,
struct as_region
{
struct as_region *next;
- addr_t addr;
+ vg_addr_t addr;
};
struct as_region *as_regions = NULL;
#endif
- struct as_allocate_pt_ret allocate_object (enum cap_type type, addr_t addr)
+ struct as_allocate_pt_ret allocate_object (enum vg_cap_type type, vg_addr_t addr)
{
debug (5, "(%s, 0x%llx/%d)",
- cap_type_string (type), addr_prefix (addr), addr_depth (addr));
+ vg_cap_type_string (type), vg_addr_prefix (addr), vg_addr_depth (addr));
- assert (type != cap_void);
- assert (type != cap_folio);
+ assert (type != vg_cap_void);
+ assert (type != vg_cap_folio);
- if (! have_folio || folio_index == FOLIO_OBJECTS)
+ if (! have_folio || folio_index == VG_FOLIO_OBJECTS)
/* Allocate additional storage. */
{
- int w = FOLIO_OBJECTS_LOG2 + PAGESIZE_LOG2;
+ int w = VG_FOLIO_OBJECTS_LOG2 + PAGESIZE_LOG2;
if (! have_folio)
{
- folio_task_addr = ADDR (FOLIO_START, ADDR_BITS - w);
+ folio_task_addr = VG_ADDR (FOLIO_START, VG_ADDR_BITS - w);
have_folio = true;
}
else
/* Move to the next free space. */
- folio_task_addr = ADDR (addr_prefix (folio_task_addr) + (1ULL << w),
- ADDR_BITS - w);
+ folio_task_addr = VG_ADDR (vg_addr_prefix (folio_task_addr) + (1ULL << w),
+ VG_ADDR_BITS - w);
- debug (5, "Allocating folio at " ADDR_FMT,
- ADDR_PRINTF (folio_task_addr));
+ debug (5, "Allocating folio at " VG_ADDR_FMT,
+ VG_ADDR_PRINTF (folio_task_addr));
#ifdef RM_INTERN
- folio_local_addr = folio_alloc (root_activity, FOLIO_POLICY_DEFAULT);
+ folio_local_addr = folio_alloc (root_activity, VG_FOLIO_POLICY_DEFAULT);
if (! folio_local_addr)
panic ("Out of memory");
#else
folio_local_addr = as_alloc (w, 1, true);
- if (ADDR_IS_VOID (folio_local_addr))
+ if (VG_ADDR_IS_VOID (folio_local_addr))
panic ("Failed to allocate address space for folio");
struct as_region *as_region = malloc (sizeof (*as_region));
@@ -368,16 +368,16 @@ process_spawn (addr_t activity,
as_ensure (folio_local_addr);
error_t err = rm_folio_alloc (activity, activity,
- FOLIO_POLICY_DEFAULT,
+ VG_FOLIO_POLICY_DEFAULT,
&folio_local_addr);
if (err)
panic ("Failed to allocate folio");
- assert (! ADDR_IS_VOID (folio_local_addr));
+ assert (! VG_ADDR_IS_VOID (folio_local_addr));
as_slot_lookup_use (folio_local_addr,
({
- slot->type = cap_folio;
- CAP_SET_SUBPAGE (slot, 0, 1);
+ slot->type = vg_cap_folio;
+ VG_CAP_SET_SUBPAGE (slot, 0, 1);
}));
#endif
@@ -390,7 +390,7 @@ process_spawn (addr_t activity,
struct hurd_object_desc *desc = &descs[startup_data->desc_count ++];
desc->object = folio_task_addr;
- desc->type = cap_folio;
+ desc->type = vg_cap_folio;
/* We need to insert the folio into the task's address
space, however, that is not yet possible as we may be
@@ -410,30 +410,30 @@ process_spawn (addr_t activity,
int index = folio_index ++;
- debug (5, "Allocating " ADDR_FMT " (%s)",
- ADDR_PRINTF (addr_extend (folio_task_addr,
- index, FOLIO_OBJECTS_LOG2)),
- cap_type_string (type));
+ debug (5, "Allocating " VG_ADDR_FMT " (%s)",
+ VG_ADDR_PRINTF (vg_addr_extend (folio_task_addr,
+ index, VG_FOLIO_OBJECTS_LOG2)),
+ vg_cap_type_string (type));
#ifdef RM_INTERN
rt.cap = folio_object_alloc (root_activity,
folio_local_addr, index,
- cap_type_strengthen (type),
- OBJECT_POLICY_VOID, 0);
+ vg_cap_type_strengthen (type),
+ VG_OBJECT_POLICY_VOID, 0);
#else
- rm_folio_object_alloc (ADDR_VOID,
+ rm_folio_object_alloc (VG_ADDR_VOID,
folio_local_addr, index,
- cap_type_strengthen (type),
- OBJECT_POLICY_VOID, 0, NULL, NULL);
- rt.cap.type = cap_type_strengthen (type);
- CAP_PROPERTIES_SET (&rt.cap, CAP_PROPERTIES_VOID);
+ vg_cap_type_strengthen (type),
+ VG_OBJECT_POLICY_VOID, 0, NULL, NULL);
+ rt.cap.type = vg_cap_type_strengthen (type);
+ VG_CAP_PROPERTIES_SET (&rt.cap, VG_CAP_PROPERTIES_VOID);
#ifndef NDEBUG
- if (rt.cap.type == cap_page)
+ if (rt.cap.type == vg_cap_page)
{
unsigned int *p
- = ADDR_TO_PTR (addr_extend (addr_extend (folio_local_addr,
- index, FOLIO_OBJECTS_LOG2),
+ = VG_ADDR_TO_PTR (vg_addr_extend (vg_addr_extend (folio_local_addr,
+ index, VG_FOLIO_OBJECTS_LOG2),
0, PAGESIZE_LOG2));
int i;
for (i = 0; i < PAGESIZE / sizeof (int); i ++)
@@ -449,8 +449,8 @@ process_spawn (addr_t activity,
panic ("Initial task too large.");
struct hurd_object_desc *desc = &descs[startup_data->desc_count ++];
- desc->storage = addr_extend (folio_task_addr, index, FOLIO_OBJECTS_LOG2);
- if (ADDR_IS_VOID (addr))
+ desc->storage = vg_addr_extend (folio_task_addr, index, VG_FOLIO_OBJECTS_LOG2);
+ if (VG_ADDR_IS_VOID (addr))
desc->object = desc->storage;
else
desc->object = addr;
@@ -462,17 +462,17 @@ process_spawn (addr_t activity,
rt.storage = desc->storage;
#else
/* We need to reference the storage in our address space. */
- rt.storage = addr_extend (folio_local_addr, index, FOLIO_OBJECTS_LOG2);
+ rt.storage = vg_addr_extend (folio_local_addr, index, VG_FOLIO_OBJECTS_LOG2);
#endif
- debug (5, "cap: " CAP_FMT, CAP_PRINTF (&rt.cap));
+ debug (5, "cap: " VG_CAP_FMT, VG_CAP_PRINTF (&rt.cap));
return rt;
}
- struct as_allocate_pt_ret allocate_page_table (addr_t addr)
+ struct as_allocate_pt_ret allocate_page_table (vg_addr_t addr)
{
- debug (5, ADDR_FMT, ADDR_PRINTF (addr));
- return allocate_object (cap_cappage, addr);
+ debug (5, VG_ADDR_FMT, VG_ADDR_PRINTF (addr));
+ return allocate_object (vg_cap_cappage, addr);
}
struct as_allocate_pt_ret rt;
@@ -492,63 +492,63 @@ process_spawn (addr_t activity,
A way around this problem would be the approach that EROS takes:
start with a hand-created system image. */
- rt = allocate_object (cap_activity_control, ADDR_VOID);
+ rt = allocate_object (vg_cap_activity_control, VG_ADDR_VOID);
startup_data->activity = rt.storage;
- root_activity = (struct activity *) cap_to_object (root_activity, &rt.cap);
+ root_activity = (struct activity *) vg_cap_to_object (root_activity, &rt.cap);
folio_parent (root_activity, folio_local_addr);
/* We know that we are the only one who can access the data
structure, however, the object_claim asserts that this lock is
held. */
object_claim (root_activity, (struct object *) root_activity,
- OBJECT_POLICY_VOID, true);
+ VG_OBJECT_POLICY_VOID, true);
object_claim (root_activity, (struct object *) folio_local_addr,
- OBJECT_POLICY_VOID, true);
+ VG_OBJECT_POLICY_VOID, true);
#else
struct hurd_object_desc *desc;
- struct cap cap;
+ struct vg_cap cap;
memset (&cap, 0, sizeof (cap));
bool r;
/* Stash the activity two pages before the first folio. */
desc = &descs[startup_data->desc_count ++];
- desc->storage = ADDR_VOID;
- desc->object = ADDR (FOLIO_START - 2 * PAGESIZE, ADDR_BITS - PAGESIZE_LOG2);
- desc->type = cap_activity;
+ desc->storage = VG_ADDR_VOID;
+ desc->object = VG_ADDR (FOLIO_START - 2 * PAGESIZE, VG_ADDR_BITS - PAGESIZE_LOG2);
+ desc->type = vg_cap_activity;
startup_data->activity = desc->object;
/* Insert it into the target address space. */
- cap.type = cap_activity;
- struct cap *slot = as_insert_custom (ADDR_VOID,
- as_root, as_root_cap, desc->object,
- ADDR_VOID, cap, activity,
- allocate_page_table, do_index);
+ cap.type = vg_cap_activity;
+ struct vg_cap *slot = as_insert_custom (VG_ADDR_VOID,
+ as_root, as_root_cap, desc->object,
+ VG_ADDR_VOID, cap, activity,
+ allocate_page_table, do_index);
/* Weaken the capability. */
- r = cap_copy_x (root_activity, as_root, slot, desc->object,
- as_root, *slot, desc->object,
- CAP_COPY_WEAKEN, CAP_PROPERTIES_VOID);
+ r = vg_cap_copy_x (root_activity, as_root, slot, desc->object,
+ as_root, *slot, desc->object,
+ VG_CAP_COPY_WEAKEN, VG_CAP_PROPERTIES_VOID);
assert (r);
#endif
/* Allocate the thread. */
- rt = allocate_object (cap_thread, ADDR_VOID);
- assert (descs[startup_data->desc_count - 1].type == cap_thread);
+ rt = allocate_object (vg_cap_thread, VG_ADDR_VOID);
+ assert (descs[startup_data->desc_count - 1].type == vg_cap_thread);
startup_data->thread = descs[startup_data->desc_count - 1].object;
#ifdef RM_INTERN
- struct thread *thread = (struct thread *) cap_to_object (root_activity,
+ struct thread *thread = (struct thread *) vg_cap_to_object (root_activity,
&rt.cap);
#else
- addr_t thread = capalloc ();
- cap.type = cap_thread;
+ vg_addr_t thread = capalloc ();
+ cap.type = vg_cap_thread;
as_slot_lookup_use
(thread,
({
- r = cap_copy (root_activity,
- ADDR_VOID, slot, thread,
- ADDR_VOID, rt.cap, rt.storage);
+ r = vg_cap_copy (root_activity,
+ VG_ADDR_VOID, slot, thread,
+ VG_ADDR_VOID, rt.cap, rt.storage);
assert (r);
}));
#endif
@@ -567,23 +567,23 @@ process_spawn (addr_t activity,
debug (5, "%x (ro:%d)", ptr, ro);
- addr_t addr = addr_chop (PTR_TO_ADDR (ptr), PAGESIZE_LOG2);
+ vg_addr_t addr = vg_addr_chop (VG_PTR_TO_ADDR (ptr), PAGESIZE_LOG2);
- struct as_allocate_pt_ret rt = allocate_object (cap_page, addr);
+ struct as_allocate_pt_ret rt = allocate_object (vg_cap_page, addr);
as_insert_custom (root_activity,
as_root, as_root_cap, addr,
- ADDR_VOID, rt.cap, rt.storage,
+ VG_ADDR_VOID, rt.cap, rt.storage,
allocate_page_table, do_index);
if (ro)
as_slot_lookup_rel_use (root_activity, as_root_cap, addr,
({
- bool r = cap_copy_x (root_activity,
+ bool r = vg_cap_copy_x (root_activity,
as_root, slot, addr,
as_root, *slot, addr,
- CAP_COPY_WEAKEN,
- CAP_PROPERTIES_VOID);
+ VG_CAP_COPY_WEAKEN,
+ VG_CAP_PROPERTIES_VOID);
assert (r);
}));
@@ -613,11 +613,11 @@ process_spawn (addr_t activity,
assert ((ptr & (PAGESIZE - 1)) == 0);
#ifdef RM_INTERN
- addr_t addr = addr_chop (PTR_TO_ADDR (ptr), PAGESIZE_LOG2);
- struct cap cap = as_object_lookup_rel (root_activity,
+ vg_addr_t addr = vg_addr_chop (VG_PTR_TO_ADDR (ptr), PAGESIZE_LOG2);
+ struct vg_cap cap = as_object_lookup_rel (root_activity,
as_root_cap, addr,
- cap_rpage, NULL);
- local = cap_to_object (root_activity, &cap);
+ vg_cap_rpage, NULL);
+ local = vg_cap_to_object (root_activity, &cap);
#else
local = hurd_ihash_find (&map, ptr);
#endif
@@ -638,11 +638,11 @@ process_spawn (addr_t activity,
int i;
for (i = 0; i < 2; i ++)
{
- rt = allocate_object (cap_messenger, ADDR_VOID);
- assert (descs[startup_data->desc_count - 1].type == cap_messenger);
+ rt = allocate_object (vg_cap_messenger, VG_ADDR_VOID);
+ assert (descs[startup_data->desc_count - 1].type == vg_cap_messenger);
startup_data->messengers[i] = descs[startup_data->desc_count - 1].object;
- debug (5, "Messenger %d: " ADDR_FMT,
- i, ADDR_PRINTF (startup_data->messengers[i]));
+ debug (5, "Messenger %d: " VG_ADDR_FMT,
+ i, VG_ADDR_PRINTF (startup_data->messengers[i]));
}
/* We need to 1) insert the folios in the address space, 2) fix up
@@ -661,21 +661,21 @@ process_spawn (addr_t activity,
{
struct hurd_object_desc *desc = &descs[d];
- if (desc->type == cap_folio)
+ if (desc->type == vg_cap_folio)
{
- struct cap cap;
+ struct vg_cap cap;
#ifdef RM_INTERN
cap = object_to_cap ((struct object *) (uintptr_t)
desc->storage.raw);
- assert (cap.type == cap_folio);
+ assert (cap.type == vg_cap_folio);
#else
memset (&cap, 0, sizeof (cap));
- cap.type = cap_folio;
+ cap.type = vg_cap_folio;
#endif
- as_insert_custom (ADDR_VOID,
+ as_insert_custom (VG_ADDR_VOID,
as_root, as_root_cap, desc->object,
- ADDR_VOID, cap, desc->storage,
+ VG_ADDR_VOID, cap, desc->storage,
allocate_page_table, do_index);
desc->storage = desc->object;
@@ -691,15 +691,15 @@ process_spawn (addr_t activity,
+ PAGESIZE - 1) / PAGESIZE;
page ++)
{
- addr_t addr = ADDR (STARTUP_DATA_ADDR + page * PAGESIZE,
- ADDR_BITS - PAGESIZE_LOG2);
+ vg_addr_t addr = VG_ADDR (STARTUP_DATA_ADDR + page * PAGESIZE,
+ VG_ADDR_BITS - PAGESIZE_LOG2);
- struct as_allocate_pt_ret rt = allocate_object (cap_page, addr);
+ struct as_allocate_pt_ret rt = allocate_object (vg_cap_page, addr);
pages[page] = rt_to_object (rt);
- as_insert_custom (ADDR_VOID, as_root, as_root_cap, addr,
- ADDR_VOID, rt.cap, rt.storage,
+ as_insert_custom (VG_ADDR_VOID, as_root, as_root_cap, addr,
+ VG_ADDR_VOID, rt.cap, rt.storage,
allocate_page_table, do_index);
}
}
@@ -729,10 +729,10 @@ process_spawn (addr_t activity,
{
debug (0, "%d descriptors", startup_data->desc_count);
for (i = 0; i < startup_data->desc_count; i ++)
- debug (0, ADDR_FMT " (" ADDR_FMT "): %s",
- ADDR_PRINTF (descs[i].object),
- ADDR_PRINTF (descs[i].storage),
- cap_type_string (descs[i].type));
+ debug (0, VG_ADDR_FMT " (" VG_ADDR_FMT "): %s",
+ VG_ADDR_PRINTF (descs[i].object),
+ VG_ADDR_PRINTF (descs[i].storage),
+ vg_cap_type_string (descs[i].type));
}
/* Free the staging area. */
@@ -753,8 +753,8 @@ process_spawn (addr_t activity,
HURD_EXREGS_SET_SP_IP
| (make_runnable ? HURD_EXREGS_START : 0)
| HURD_EXREGS_ABORT_IPC,
- CAP_VOID, 0, CAP_PROPERTIES_VOID,
- CAP_VOID, CAP_VOID, CAP_VOID,
+ VG_CAP_VOID, 0, VG_CAP_PROPERTIES_VOID,
+ VG_CAP_VOID, VG_CAP_VOID, VG_CAP_VOID,
&sp, &ip, NULL, NULL);
#else
/* Start thread. */
@@ -762,21 +762,21 @@ process_spawn (addr_t activity,
/* Per the API (cf. <hurd/startup.h>). */
in.sp = STARTUP_DATA_ADDR;
in.ip = ip;
- in.aspace_cap_properties = CAP_PROPERTIES_VOID;
- in.aspace_cap_properties_flags = CAP_COPY_COPY_SOURCE_GUARD;
+ in.aspace_cap_properties = VG_CAP_PROPERTIES_VOID;
+ in.aspace_cap_properties_flags = VG_CAP_COPY_COPY_SOURCE_GUARD;
error_t err;
struct hurd_thread_exregs_out out;
/* XXX: Use a weakened activity. */
- err = rm_thread_exregs (ADDR_VOID, thread,
+ err = rm_thread_exregs (VG_ADDR_VOID, thread,
HURD_EXREGS_SET_SP_IP
| HURD_EXREGS_SET_ASPACE
| HURD_EXREGS_SET_ACTIVITY
| (make_runnable ? HURD_EXREGS_START : 0)
| HURD_EXREGS_ABORT_IPC,
- in, addr_extend (as_root, THREAD_ASPACE_SLOT,
- THREAD_SLOTS_LOG2),
- activity, ADDR_VOID, ADDR_VOID,
+ in, vg_addr_extend (as_root, VG_THREAD_ASPACE_SLOT,
+ VG_THREAD_SLOTS_LOG2),
+ activity, VG_ADDR_VOID, VG_ADDR_VOID,
&out, NULL, NULL, NULL, NULL);
#endif
if (err)
diff --git a/libc-parts/process-spawn.h b/libc-parts/process-spawn.h
index b11d5ae..8d68f1f 100644
--- a/libc-parts/process-spawn.h
+++ b/libc-parts/process-spawn.h
@@ -25,8 +25,8 @@
slot is allocated with capalloc. If MAKE_RUNNABLE is true, makes
the process' thread runnable. Otherwise, the thread remains
suspended and may be started with thread_start. */
-extern thread_t process_spawn (addr_t activity,
- void *start, void *end,
- const char *const argv[],
- const char *const env[],
- bool make_runnable);
+extern vg_thread_t process_spawn (vg_addr_t activity,
+ void *start, void *end,
+ const char *const argv[],
+ const char *const env[],
+ bool make_runnable);
diff --git a/libc-parts/s_printf.c b/libc-parts/s_printf.c
index fa417fb..f7e55f9 100644
--- a/libc-parts/s_printf.c
+++ b/libc-parts/s_printf.c
@@ -40,7 +40,7 @@ io_buffer_flush (struct io_buffer *buffer)
if (buffer->len == 0)
return;
- // rm_write_send_nonblocking (ADDR_VOID, ADDR_VOID, *buffer, ADDR_VOID);
+ // rm_write_send_nonblocking (VG_ADDR_VOID, VG_ADDR_VOID, *buffer, VG_ADDR_VOID);
l4_msg_tag_t tag = l4_niltag;
l4_msg_tag_set_label (&tag, 2132);