Changeset 22f7769 in mainline for src/mm/heap.c


Ignore:
Timestamp:
2005-10-17T23:31:41Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4b2c872d
Parents:
75eacab
Message:

Rename cpu_priority_{high|low|restore|read} functions to interrupts_{disable|enable|restore|read}.
Rename pri_t to ipl_t (Interrupt Priority Level).
Rename thread_t::pri to thread_t::priority.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mm/heap.c

    r75eacab r22f7769  
    6161void *early_malloc(size_t size)
    6262{
    63         pri_t pri;
     63        ipl_t ipl;
    6464        chunk_t *x, *y, *z;
    6565
     
    6868               
    6969        x = chunk0;
    70         pri = cpu_priority_high();
     70        ipl = interrupts_disable();
    7171        spinlock_lock(&heaplock);               
    7272        while (x) {
     
    8585                if (x->size < size + sizeof(chunk_t) + 1) {
    8686                        spinlock_unlock(&heaplock);
    87                         cpu_priority_restore(pri);
     87                        interrupts_restore(ipl);
    8888                        return &x->data[0];
    8989                }
     
    106106                x->next = y;
    107107                spinlock_unlock(&heaplock);
    108                 cpu_priority_restore(pri);
     108                interrupts_restore(ipl);
    109109
    110110                return &x->data[0];
    111111        }
    112112        spinlock_unlock(&heaplock);
    113         cpu_priority_restore(pri);
     113        interrupts_restore(ipl);
    114114        return NULL;
    115115}
     
    117117void early_free(void *ptr)
    118118{
    119         pri_t pri;
     119        ipl_t ipl;
    120120        chunk_t *x, *y, *z;
    121121
     
    128128                panic("freeing unused/damaged chunk");
    129129
    130         pri = cpu_priority_high();
     130        ipl = interrupts_disable();
    131131        spinlock_lock(&heaplock);
    132132        x = y->prev;
     
    151151        y->used = 0;
    152152        spinlock_unlock(&heaplock);
    153         cpu_priority_restore(pri);
     153        interrupts_restore(ipl);
    154154}
Note: See TracChangeset for help on using the changeset viewer.