36 |
#include "zalloc.h" |
#include "zalloc.h" |
37 |
|
|
38 |
static error_t |
static error_t |
39 |
frame_entry_constructor (void *hook, void *buffer) |
frame_entry_constructor (void *hook, struct frame_entry *frame_entry) |
40 |
{ |
{ |
|
struct frame_entry *frame_entry = buffer; |
|
|
|
|
41 |
frame_entry->shared_next = frame_entry; |
frame_entry->shared_next = frame_entry; |
42 |
frame_entry->shared_prevp = &frame_entry->shared_next; |
frame_entry->shared_prevp = &frame_entry->shared_next; |
43 |
|
|
44 |
return 0; |
return 0; |
45 |
} |
} |
46 |
|
|
47 |
static struct hurd_slab_space frame_entry_space |
SLAB_CLASS(frame_entry, struct frame_entry) |
48 |
= HURD_SLAB_SPACE_INITIALIZER (struct frame_entry, |
|
49 |
NULL, NULL, |
static struct hurd_frame_entry_slab_space frame_entry_space; |
50 |
frame_entry_constructor, NULL, |
|
51 |
NULL); |
void |
52 |
|
frame_entry_init (void) |
53 |
|
{ |
54 |
|
hurd_frame_entry_slab_init (&frame_entry_space, NULL, NULL, |
55 |
|
frame_entry_constructor, NULL, NULL); |
56 |
|
} |
57 |
|
|
58 |
void |
void |
59 |
frame_entry_dump (struct frame_entry *fe) |
frame_entry_dump (struct frame_entry *fe) |
88 |
error_t err; |
error_t err; |
89 |
struct frame_entry *frame_entry; |
struct frame_entry *frame_entry; |
90 |
|
|
91 |
err = hurd_slab_alloc (&frame_entry_space, (void *) &frame_entry); |
err = hurd_frame_entry_slab_alloc (&frame_entry_space, &frame_entry); |
92 |
if (err) |
if (err) |
93 |
return 0; |
return 0; |
94 |
|
|
106 |
memset (frame_entry, 0xfe, sizeof (struct frame_entry)); |
memset (frame_entry, 0xfe, sizeof (struct frame_entry)); |
107 |
frame_entry_constructor (0, frame_entry); |
frame_entry_constructor (0, frame_entry); |
108 |
#endif |
#endif |
109 |
hurd_slab_dealloc (&frame_entry_space, frame_entry); |
hurd_frame_entry_slab_dealloc (&frame_entry_space, frame_entry); |
110 |
} |
} |
111 |
|
|
112 |
/* If SHARE is non-NULL, add FRAME_ENTRY (which is not attach to any |
/* If SHARE is non-NULL, add FRAME_ENTRY (which is not attach to any |