16#ifndef __L4_SIGMA0_SIGMA0_H
17#define __L4_SIGMA0_SIGMA0_H
37#undef SIGMA0_REQ_MAGIC
40# define SIGMA0_REQ_MAGIC ~0xFFUL
41# define SIGMA0_REQ_MASK ~0xFFUL
45#define SIGMA0_REQ_ID_MASK 0xF0
46#define SIGMA0_REQ_ID_FPAGE_RAM 0x60
47#define SIGMA0_REQ_ID_FPAGE_IOMEM 0x70
48#define SIGMA0_REQ_ID_FPAGE_IOMEM_CACHED 0x80
49#define SIGMA0_REQ_ID_FPAGE_ANY 0x90
50#define SIGMA0_REQ_ID_KIP 0xA0
51#define SIGMA0_REQ_ID_DEBUG_DUMP 0xC0
53#define SIGMA0_IS_MAGIC_REQ(d1) \
54 ((d1 & SIGMA0_REQ_MASK) == SIGMA0_REQ_MAGIC)
56#define SIGMA0_REQ(x) \
57 (SIGMA0_REQ_MAGIC + SIGMA0_REQ_ID_ ## x)
60#define SIGMA0_REQ_FPAGE_RAM (SIGMA0_REQ(FPAGE_RAM))
61#define SIGMA0_REQ_FPAGE_IOMEM (SIGMA0_REQ(FPAGE_IOMEM))
62#define SIGMA0_REQ_FPAGE_IOMEM_CACHED (SIGMA0_REQ(FPAGE_IOMEM_CACHED))
63#define SIGMA0_REQ_FPAGE_ANY (SIGMA0_REQ(FPAGE_ANY))
64#define SIGMA0_REQ_KIP (SIGMA0_REQ(KIP))
65#define SIGMA0_REQ_DEBUG_DUMP (SIGMA0_REQ(DEBUG_DUMP))
212 case 0:
return "No error";
213 case -1:
return "Phys, virt or size not aligned";
214 case -2:
return "IPC error";
215 case -3:
return "No fpage received";
216#ifndef SIGMA0_REQ_MAGIC
217 case -4:
return "Bad physical address (old protocol only)";
219 case -6:
return "Superpage requested but smaller flexpage received";
220 case -7:
return "Cannot map I/O memory cacheable (old protocol only)";
221 default:
return "Unknown error";
L4 compiler related defines.
unsigned long l4_addr_t
Address type.
unsigned long l4_cap_idx_t
Capability selector type.
int l4sigma0_map_mem(l4_cap_idx_t sigma0, l4_addr_t phys, l4_addr_t virt, l4_addr_t size)
Request a memory mapping from sigma0.
char const * l4sigma0_map_errstr(int err)
Get user readable error messages for the return codes.
int l4sigma0_map_iomem(l4_cap_idx_t sigma0, l4_addr_t phys, l4_addr_t virt, l4_addr_t size, int cached)
Request IO memory from sigma0.
l4_kernel_info_t * l4sigma0_map_kip(l4_cap_idx_t sigma0, void *addr, unsigned log2_size)
Map the kernel info page from sigma0 to addr.
l4sigma0_return_flags_t
Return flags of libsigma0 functions.
void l4sigma0_debug_dump(l4_cap_idx_t sigma0)
Request sigma0 to dump internal debug information.
int l4sigma0_map_anypage(l4_cap_idx_t sigma0, l4_addr_t map_area, unsigned log2_map_size, l4_addr_t *base, unsigned sz)
Request an arbitrary free page of RAM.
@ L4SIGMA0_NOTALIGNED
Phys, virt or size not aligned.
@ L4SIGMA0_IPCERROR
IPC error.
@ L4SIGMA0_NOFPAGE
No fpage received.
@ L4SIGMA0_SMALLERFPAGE
Superpage requested but smaller flexpage received.
#define L4_CV
Define calling convention.
#define L4_INLINE
L4 Inline function attribute.
#define EXTERN_C_BEGIN
Start section with C types and functions.
#define EXTERN_C_END
End section with C types and functions.
Common L4 ABI Data Types.
L4 Kernel Interface Page.
Kernel Info Page access functions.