Changeset 32ff43e6 in mainline


Ignore:
Timestamp:
2005-09-28T13:00:11Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a9543d
Parents:
a58db280
Message:

Redeclare eraly_malloc() with attribute ((malloc)) to improve optimizations.

Reorganize #include's in scheduler.c.

Buddy system improvements.
Make buddy_system_free() explicitly invalidate order of blocks before they are coalesced.
Add some assertions.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • include/mm/buddy.h

    ra58db280 r32ff43e6  
    3333#include <typedefs.h>
    3434
     35#define BUDDY_SYSTEM_INNER_BLOCK        0xff
     36
    3537struct buddy_operations {
    3638        link_t *(* find_buddy)(link_t *);
  • include/mm/heap.h

    ra58db280 r32ff43e6  
    4646extern void early_heap_init(__address heap, size_t size);
    4747
    48 extern void *early_malloc(size_t size);
     48extern void *early_malloc(size_t size) __attribute__ ((malloc));
    4949extern void early_free(void *ptr);
    5050
  • src/mm/buddy.c

    ra58db280 r32ff43e6  
    4949        int i;
    5050
     51        ASSERT(max_order < BUDDY_SYSTEM_INNER_BLOCK);
     52
    5153        ASSERT(op->find_buddy);
    5254        ASSERT(op->set_order);
     
    167169       
    168170        if (buddy && i != b->max_order - 1) {
     171
     172                ASSERT(b->op->get_order(buddy) == i);
     173               
    169174                /*
    170175                 * Remove buddy from the list of order i.
     
    173178               
    174179                /*
     180                 * Invalidate order of both block and buddy.
     181                 */
     182                b->op->set_order(block, BUDDY_SYSTEM_INNER_BLOCK);
     183                b->op->set_order(buddy, BUDDY_SYSTEM_INNER_BLOCK);
     184               
     185                /*
    175186                 * Coalesce block and buddy into one block.
    176187                 */
  • src/proc/scheduler.c

    ra58db280 r32ff43e6  
    3030#include <proc/thread.h>
    3131#include <proc/task.h>
    32 #include <cpu.h>
     32#include <mm/heap.h>
     33#include <mm/frame.h>
     34#include <mm/page.h>
    3335#include <mm/vm.h>
     36#include <arch/asm.h>
     37#include <arch/faddr.h>
     38#include <arch/atomic.h>
     39#include <synch/spinlock.h>
    3440#include <config.h>
    3541#include <context.h>
    3642#include <func.h>
    3743#include <arch.h>
    38 #include <arch/asm.h>
    3944#include <list.h>
    4045#include <panic.h>
    4146#include <typedefs.h>
    42 #include <mm/page.h>
    43 #include <synch/spinlock.h>
    44 #include <arch/faddr.h>
    45 #include <arch/atomic.h>
     47#include <cpu.h>
    4648#include <print.h>
    47 #include <mm/frame.h>
    48 #include <mm/heap.h>
    4949#include <debug.h>
    5050
Note: See TracChangeset for help on using the changeset viewer.