Changeset adecf496 in mainline


Ignore:
Timestamp:
2005-09-23T22:54:45Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
48a02ef
Parents:
4841104
Message:

Revert previous change in frame_t as it broke IA-64.
(Most likely some alignment problem.)

Rename heap_init(), malloc() and free(), respectively, to early_heap_init(), early_malloc() and early_free(), respectively.
Define new macros malloc() and free(). They are to be replaced by real functions some day.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • include/mm/frame.h

    r4841104 radecf496  
    5353        count_t refcount;       /**< when == 0, the frame is in free list */
    5454        link_t link;            /**< link to zone free list when refcount == 0 */
    55 } __attribute__ ((packed));
     55};
    5656
    5757extern spinlock_t zone_head_lock;       /**< this lock protects zone_head list */
  • include/mm/heap.h

    r4841104 radecf496  
    3333#include <typedefs.h>
    3434
     35#define malloc(size)            early_malloc(size)
     36#define free(ptr)               early_free(ptr)
     37
    3538struct chunk {
    3639        int used;
     
    4144};
    4245
    43 extern void heap_init(__address heap, size_t size);
     46extern void early_heap_init(__address heap, size_t size);
    4447
    45 extern void *malloc(size_t size);
    46 extern void free(void *ptr);
     48extern void *early_malloc(size_t size);
     49extern void early_free(void *ptr);
    4750
    4851#endif
  • src/main/main.c

    r4841104 radecf496  
    148148       
    149149        arch_pre_mm_init();
    150         heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta);
     150        early_heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, heap_size + heap_delta);
    151151        frame_init();
    152152        page_init();
  • src/mm/frame.c

    r4841104 radecf496  
    299299        cnt = size / FRAME_SIZE;
    300300       
    301         z = (zone_t *) malloc(sizeof(zone_t));
     301        z = (zone_t *) early_malloc(sizeof(zone_t));
    302302        if (z) {
    303303                link_initialize(&z->link);
     
    312312                z->busy_count = 0;
    313313               
    314                 z->frames = (frame_t *) malloc(cnt * sizeof(frame_t));
     314                z->frames = (frame_t *) early_malloc(cnt * sizeof(frame_t));
    315315                if (!z->frames) {
    316316                        free(z);
  • src/mm/heap.c

    r4841104 radecf496  
    4545static spinlock_t heaplock;
    4646
    47 void heap_init(__address heap, size_t size)
     47void early_heap_init(__address heap, size_t size)
    4848{
    4949        spinlock_initialize(&heaplock);
     
    5959 * Uses first-fit algorithm.
    6060 */
    61 void *malloc(size_t size)
     61void *early_malloc(size_t size)
    6262{
    6363        pri_t pri;
     
    115115}
    116116
    117 void free(void *ptr)
     117void early_free(void *ptr)
    118118{
    119119        pri_t pri;
Note: See TracChangeset for help on using the changeset viewer.