Rev 788 | Rev 831 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 788 | Rev 830 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | #include <arch/mm/asid.h> |
30 | #include <arch/mm/asid.h> |
31 | #include <mm/asid.h> |
31 | #include <mm/asid.h> |
32 | #include <typedefs.h> |
32 | #include <typedefs.h> |
33 | #include <adt/fifo.h> |
33 | #include <adt/fifo.h> |
34 | 34 | ||
- | 35 | #define FIFO_STATIC_LIMIT 1024 |
|
- | 36 | #define FIFO_STATIC (ASIDS_ALLOCABLE<FIFO_STATIC_LIMIT) |
|
35 | /** |
37 | /** |
36 | * FIFO queue containing unassigned ASIDs. |
38 | * FIFO queue containing unassigned ASIDs. |
37 | * Can be only accessed when asidlock is held. |
39 | * Can be only accessed when asidlock is held. |
38 | */ |
40 | */ |
- | 41 | #if FIFO_STATIC |
|
39 | FIFO_INITIALIZE(free_asids, asid_t, ASIDS_ALLOCABLE); |
42 | FIFO_INITIALIZE_STATIC(free_asids, asid_t, ASIDS_ALLOCABLE); |
- | 43 | #else |
|
- | 44 | FIFO_INITIALIZE_DYNAMIC(free_asids, asid_t, ASIDS_ALLOCABLE); |
|
- | 45 | #endif |
|
40 | 46 | ||
41 | /** Initialize data structures for O(1) ASID allocation and deallocation. */ |
47 | /** Initialize data structures for O(1) ASID allocation and deallocation. */ |
42 | void asid_fifo_init(void) |
48 | void asid_fifo_init(void) |
43 | { |
49 | { |
44 | int i; |
50 | int i; |
- | 51 | ||
- | 52 | #if (!FIFO_STATIC) |
|
- | 53 | fifo_create(free_asids); |
|
- | 54 | #endif |
|
45 | 55 | ||
46 | for (i = 0; i < ASIDS_ALLOCABLE; i++) { |
56 | for (i = 0; i < ASIDS_ALLOCABLE; i++) { |
47 | fifo_push(free_asids, ASID_START + i); |
57 | fifo_push(free_asids, ASID_START + i); |
48 | } |
58 | } |
49 | } |
59 | } |
50 | 60 |