Changeset 7f1c620 in mainline for generic/src/mm/frame.c


Ignore:
Timestamp:
2006-07-04T17:17:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffa3ef5
Parents:
991779c5
Message:

Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/mm/frame.c

    r991779c5 r7f1c620  
    7070typedef struct {
    7171        count_t refcount;       /**< tracking of shared frames  */
    72         __u8 buddy_order;       /**< buddy system block order */
     72        uint8_t buddy_order;    /**< buddy system block order */
    7373        link_t buddy_link;      /**< link to the next free block inside one order */
    7474        void *parent;           /**< If allocated by slab, this points there */
     
    218218
    219219/** @return True if zone can allocate specified order */
    220 static int zone_can_alloc(zone_t *z, __u8 order)
     220static int zone_can_alloc(zone_t *z, uint8_t order)
    221221{
    222222        return buddy_system_can_alloc(z->buddy_system, order);
     
    231231 * @param pzone Pointer to preferred zone or NULL, on return contains zone number
    232232 */
    233 static zone_t * find_free_zone_lock(__u8 order, int *pzone)
     233static zone_t * find_free_zone_lock(uint8_t order, int *pzone)
    234234{
    235235        int i;
     
    272272 */
    273273static link_t *zone_buddy_find_block(buddy_system_t *b, link_t *child,
    274                                      __u8 order)
     274                                     uint8_t order)
    275275{
    276276        frame_t * frame;
     
    381381 * @param order Order to set
    382382 */
    383 static void zone_buddy_set_order(buddy_system_t *b, link_t * block, __u8 order) {
     383static void zone_buddy_set_order(buddy_system_t *b, link_t * block, uint8_t order) {
    384384        frame_t * frame;
    385385        frame = list_get_instance(block, frame_t, buddy_link);
     
    394394 * @return Order of block
    395395 */
    396 static __u8 zone_buddy_get_order(buddy_system_t *b, link_t * block) {
     396static uint8_t zone_buddy_get_order(buddy_system_t *b, link_t * block) {
    397397        frame_t * frame;
    398398        frame = list_get_instance(block, frame_t, buddy_link);
     
    451451 *
    452452 */
    453 static pfn_t zone_frame_alloc(zone_t *zone, __u8 order)
     453static pfn_t zone_frame_alloc(zone_t *zone, uint8_t order)
    454454{
    455455        pfn_t v;
     
    484484{
    485485        frame_t *frame;
    486         __u8 order;
     486        uint8_t order;
    487487
    488488        frame = &zone->frames[frame_idx];
     
    538538static void _zone_merge(zone_t *z, zone_t *z1, zone_t *z2)
    539539{
    540         __u8 max_order;
     540        uint8_t max_order;
    541541        int i, z2idx;
    542542        pfn_t frame_idx;
     
    625625        int i;
    626626
    627         pfn = ADDR2PFN((__address)KA2PA(oldzone));
     627        pfn = ADDR2PFN((uintptr_t)KA2PA(oldzone));
    628628        cframes = SIZE2FRAMES(zone_conf_size(oldzone->count));
    629629       
     
    654654{
    655655        count_t i;
    656         __u8 order;
     656        uint8_t order;
    657657        frame_t *frame;
    658658       
     
    690690        zone_t *zone1, *zone2, *newzone;
    691691        int cframes;
    692         __u8 order;
     692        uint8_t order;
    693693        int i;
    694694        pfn_t pfn;
     
    780780{
    781781        int i;
    782         __u8 max_order;
     782        uint8_t max_order;
    783783
    784784        spinlock_initialize(&z->lock, "zone_lock");
     
    818818 * @return Size of zone configuration info (in bytes)
    819819 */
    820 __address zone_conf_size(count_t count)
     820uintptr_t zone_conf_size(count_t count)
    821821{
    822822        int size = sizeof(zone_t) + count*sizeof(frame_t);
     
    846846{
    847847        zone_t *z;
    848         __address addr;
     848        uintptr_t addr;
    849849        count_t confcount;
    850850        int i;
     
    932932 *
    933933 */
    934 void * frame_alloc_generic(__u8 order, int flags, int *pzone)
     934void * frame_alloc_generic(uint8_t order, int flags, int *pzone)
    935935{
    936936        ipl_t ipl;
     
    991991 * @param Frame Physical Address of of the frame to be freed.
    992992 */
    993 void frame_free(__address frame)
     993void frame_free(uintptr_t frame)
    994994{
    995995        ipl_t ipl;
     
    11001100                zone = zones.info[i];
    11011101                spinlock_lock(&zone->lock);
    1102                 printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof(__address) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count);
     1102                printf("%d: %.*p \t%10zd\t%10zd\n", i, sizeof(uintptr_t) * 2, PFN2ADDR(zone->base), zone->free_count, zone->busy_count);
    11031103                spinlock_unlock(&zone->lock);
    11041104        }
     
    11321132        spinlock_lock(&zone->lock);
    11331133        printf("Memory zone information\n");
    1134         printf("Zone base address: %#.*p\n", sizeof(__address) * 2, PFN2ADDR(zone->base));
     1134        printf("Zone base address: %#.*p\n", sizeof(uintptr_t) * 2, PFN2ADDR(zone->base));
    11351135        printf("Zone size: %zd frames (%zdK)\n", zone->count, ((zone->count) * FRAME_SIZE) >> 10);
    11361136        printf("Allocated space: %zd frames (%zdK)\n", zone->busy_count, (zone->busy_count * FRAME_SIZE) >> 10);
Note: See TracChangeset for help on using the changeset viewer.