atb.h
900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bcp.h>
#include "pi_util.h"
typedef enum {DEV_0, DEV_1, DEV_2, DEV_3} device_id;
typedef enum {ERROR, DMA_READ, PIO_READ, IV_DUMMY} permission;
typedef struct {
int iv; /* 0 not_iv, 1: iv*/
device_id dev_id; /* one of DEV_0, DEV_1 or DEV_2 */
permission perm;
u32 size_of_block; /* from 0-15 : 4 bits
0 is 16KBytes is 0x00000000, 1 is 32 KBytes
is 0x00000001 etc*/
u32 physical_address; /* 16 bits */
u32 virtual_address; /* 16 bits */
/* utilities to help access: not written to buffer*/
u32 start_page_number_virtual;
u32 start_page_number_physical;
u32 num_pages;
}atb_entry;
typedef struct {
atb_entry atb_row[PI_ATB_NUM_ENTRIES];
}atb_table;
typedef struct {
u32 start_virtual_address;
u32 start_block_address;
u32 start_virtual_page_number;
u32 start_offset_from_page_start;
u32 num_pages;
u32 *page_numbers;
} translation;