Changeset 2b50d7c in mainline for src/mm/frame.c


Ignore:
Timestamp:
2005-05-28T20:13:25Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
747a2476
Parents:
87cb9e2
Message:

IA-64 work.
Redefine FRAME_SIZE to "(16*1024)" instead of "2*4096". Note that the latter definition was wrong because of the lack of "()".
Take panic_printf(), cpu_halt() and memsetb() out of fake.s and implement them properly in asm.S.
Move ski_init_console() from arch_post_mm_init() to arch_pre_mm_init().
In start.S, write r0 to ar.bspstore.

Janitorial fixes.
Add count_t type.
Replace several occurrences of int and u32 by count_t or size_t.
Shorten several panic strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mm/frame.c

    r87cb9e2 r2b50d7c  
    4343#include <synch/spinlock.h>
    4444
    45 __u32 frames;
    46 __u32 frames_free;
     45count_t frames = 0;
     46count_t frames_free;
    4747
    4848__u8 *frame_bitmap;
    49 __u32 frame_bitmap_octets;
     49count_t frame_bitmap_octets;
    5050
    5151/*
     
    5454 */
    5555__u8 *frame_kernel_bitmap;
    56 __u32 kernel_frames;
    57 __u32 kernel_frames_free;
     56count_t kernel_frames;
     57count_t kernel_frames_free;
    5858
    5959static spinlock_t framelock;
     
    6969                frames = config.memory_size / FRAME_SIZE;
    7070                frame_bitmap_octets = frames / 8 + (frames % 8 > 0);
    71 
    7271                frame_bitmap = (__u8 *) malloc(frame_bitmap_octets);
    7372                if (!frame_bitmap)
     
    111110        pri_t pri;
    112111        __u8 **frame_bitmap_ptr = &frame_bitmap;
    113         __u32 *frames_ptr = &frames, *frames_free_ptr = &frames_free;
     112        count_t *frames_ptr = &frames, *frames_free_ptr = &frames_free;
    114113       
    115114        if (flags & FRAME_KA) {
     
    166165        pri_t pri;
    167166        __u32 frame;
    168         __u32 *frames_free_ptr = &frames_free, *frames_ptr = &frames;
     167        count_t *frames_free_ptr = &frames_free, *frames_ptr = &frames;
    169168        __u8 **frame_bitmap_ptr = &frame_bitmap;
    170169
     
    196195                        }       
    197196                }
    198                 else panic("frame_free: frame already free\n");
    199         }
    200         else panic("frame_free: frame number too big\n");
     197                else panic("frame already free\n");
     198        }
     199        else panic("frame number too big\n");
    201200       
    202201        spinlock_unlock(&framelock);
     
    212211        pri_t pri;
    213212        __u32 frame;
    214         __u32 *frames_ptr = &frames, *frames_free_ptr = &frames_free;
     213        count_t *frames_ptr = &frames, *frames_free_ptr = &frames_free;
    215214        __u8 **frame_bitmap_ptr = &frame_bitmap;
    216215       
Note: See TracChangeset for help on using the changeset viewer.