source: soft/giet_vm/giet_common/kernel_malloc.h @ 495

Last change on this file since 495 was 495, checked in by alain, 9 years ago

Introduce quad tree for distributed locks and barriers.

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1//////////////////////////////////////////////////////////////////////////////////
2// File     : kernel_malloc.h
3// Date     : 05/12/2014
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6//////////////////////////////////////////////////////////////////////////////////
7// The kernel_malloc.c and kernel_malloc.h files are part of the giet_vm kernel.
8//////////////////////////////////////////////////////////////////////////////////
9
10#ifndef KERNEL_MALLOC_H_
11#define KERNEL_MALLOC_H_
12
13#include "kernel_locks.h"
14#include "hard_config.h"
15
16
17#define MIN_BLOCK_SIZE      0x40
18
19
20//////////////////////////////////////////////////////////////////////////////////
21//             heap descriptor (one per cluster)
22//////////////////////////////////////////////////////////////////////////////////
23
24typedef struct kernel_heap_s
25{
26    spin_lock_t    lock;            // lock protecting exclusive access
27    unsigned int   heap_base;       // heap base address
28    unsigned int   heap_size;       // heap size (bytes)
29    unsigned int   free[32];        // array of base addresses of free blocks
30                                    // (address of first block of a given size)
31} kernel_heap_t;
32
33//////////////////////////////////////////////////////////////////////////////////
34//             global variables
35//////////////////////////////////////////////////////////////////////////////////
36
37extern kernel_heap_t  kernel_heap[X_SIZE][Y_SIZE];
38
39//////////////////////////////////////////////////////////////////////////////////
40//  access functions
41//////////////////////////////////////////////////////////////////////////////////
42
43extern void* _remote_malloc( unsigned int size, 
44                             unsigned int x,
45                             unsigned int y );
46
47extern void _heap_init();
48
49
50#endif
51
52// Local Variables:
53// tab-width: 4
54// c-basic-offset: 4
55// c-file-offsets:((innamespace . 0)(inline-open . 0))
56// indent-tabs-mode: nil
57// End:
58// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
59
Note: See TracBrowser for help on using the repository browser.