/[hurd]/hurd-l4/physmem/frame-entry.c
ViewVC logotype

Diff of /hurd-l4/physmem/frame-entry.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by neal, Wed Apr 6 14:07:29 2005 UTC revision 1.4 by neal, Wed Jun 22 10:18:09 2005 UTC
# Line 36  Line 36 
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)
# Line 85  frame_entry_alloc (void) Line 88  frame_entry_alloc (void)
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    
# Line 103  frame_entry_free (struct frame_entry *fr Line 106  frame_entry_free (struct frame_entry *fr
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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26