Subversion Repositories HelenOS-historic

Rev

Rev 354 | Rev 366 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 354 Rev 355
Line 38... Line 38...
38
#define FRAME_PANIC 2   /* panic on failure */
38
#define FRAME_PANIC 2   /* panic on failure */
39
 
39
 
40
struct frame_zone {
40
struct frame_zone {
41
    link_t fz_link;     /**< link to previous and next frame_zone */
41
    link_t fz_link;     /**< link to previous and next frame_zone */
42
 
42
 
43
    spinlock_t lock;    /**< this lock protexts everything below */
43
    spinlock_t lock;    /**< this lock protects everything below */
-
 
44
    __address base;     /**< physical address of the first frame in the frames array */
-
 
45
    frame_t *frames;    /**< array of frame_t structures in this zone */
44
    link_t free_head;   /**< list of free frames */
46
    link_t free_head;   /**< list of free frame_t structures */
45
    link_t busy_head;   /**< list of busy frames */
47
    link_t busy_head;   /**< list of busy frame_t structures */
46
    count_t free_count; /**< frames in free list */
48
    count_t free_count; /**< number of frame_t structures in free list */
47
    count_t busy_count; /**< frames in busy list */
49
    count_t busy_count; /**< number of frame_t structures in busy list */
48
    frame_t *frames;    /**< array of frames in this zone */
-
 
49
    int flags;
50
    int flags;
50
};
51
};
51
 
52
 
52
struct frame {
53
struct frame {
53
    count_t refcount;   /**< when > 0, the frame is in busy list, otherwise the frame is in free list */
54
    count_t refcount;   /**< when > 0, the frame is in busy list, otherwise the frame is in free list */
Line 73... Line 74...
73
__address frame_alloc(int flags);
74
__address frame_alloc(int flags);
74
extern void frame_free(__address addr);
75
extern void frame_free(__address addr);
75
extern void frame_not_free(__address addr);
76
extern void frame_not_free(__address addr);
76
extern void frame_region_not_free(__address start, __address stop);
77
extern void frame_region_not_free(__address start, __address stop);
77
 
78
 
-
 
79
extern frame_zone_t *frame_zone_create();
78
#endif
80
#endif