Subversion Repositories HelenOS

Rev

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

Rev 368 Rev 373
Line 42... Line 42...
42
 
42
 
43
    spinlock_t lock;    /**< this lock protects everything below */
43
    spinlock_t lock;    /**< this lock protects everything below */
44
    __address base;     /**< physical address of the first frame in the frames array */
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 */
45
    frame_t *frames;    /**< array of frame_t structures in this zone */
46
    link_t free_head;   /**< list of free frame_t structures */
46
    link_t free_head;   /**< list of free frame_t structures */
47
    link_t busy_head;   /**< list of busy frame_t structures */
-
 
48
    count_t free_count; /**< number of frame_t structures in free list */
47
    count_t free_count; /**< number of frame_t structures in free list */
49
    count_t busy_count; /**< number of frame_t structures in busy list */
48
    count_t busy_count; /**< number of frame_t structures not in free list */
50
    int flags;
49
    int flags;
51
};
50
};
52
 
51
 
53
struct frame {
52
struct frame {
54
    count_t refcount;   /**< when > 0, the frame is in busy list, otherwise the frame is in free list */
53
    count_t refcount;   /**< when == 0, the frame is in free list */
55
    link_t link;        /**< link either to frame_zone free or busy list */
54
    link_t link;        /**< link to zone free list when refcount == 0 */
56
};
55
} __attribute__ ((packed));
57
 
56
 
58
extern spinlock_t zone_head_lock;   /**< this lock protects zone_head list */
57
extern spinlock_t zone_head_lock;   /**< this lock protects zone_head list */
59
extern link_t zone_head;        /**< list of all zones in the system */
58
extern link_t zone_head;        /**< list of all zones in the system */
60
 
59
 
61
extern void zone_init(void);
60
extern void zone_init(void);