36 #ifndef _EPIPHANY_UTILITY_H 37 #define _EPIPHANY_UTILITY_H 51 } EPIPHANY_IRQ_PER_CORE_T;
56 #define EPIPHANY_PER_CORE_REG_CONFIG 0xF0400 57 #define EPIPHANY_PER_CORE_REG_STATUS 0xF0404 58 #define EPIPHANY_PER_CORE_REG_PC 0xF0408 59 #define EPIPHANY_PER_CORE_REG_DEBUGSTATUS 0xF040C 60 #define EPIPHANY_PER_CORE_REG_LC 0xF0414 61 #define EPIPHANY_PER_CORE_REG_LS 0xF0418 62 #define EPIPHANY_PER_CORE_REG_LE 0xF041C 63 #define EPIPHANY_PER_CORE_REG_IRET 0xF0420 64 #define EPIPHANY_PER_CORE_REG_IMASK 0xF0424 65 #define EPIPHANY_PER_CORE_REG_ILAT 0xF0428 66 #define EPIPHANY_PER_CORE_REG_ILATST 0xF042C 67 #define EPIPHANY_PER_CORE_REG_ILATCL 0xF0430 68 #define EPIPHANY_PER_CORE_REG_IPEND 0xF0434 69 #define EPIPHANY_PER_CORE_REG_FSTATUS 0xF0440 70 #define EPIPHANY_PER_CORE_REG_DEBUGCMD 0xF0448 71 #define EPIPHANY_PER_CORE_REG_RESETCORE 0xF070C 74 #define EPIPHANY_PER_CORE_REG_CTIMER0 0xF0438 75 #define EPIPHANY_PER_CORE_REG_CTIMER1 0xF043C 78 #define EPIPHANY_PER_CORE_REG_MEMSTATUS 0xF0604 79 #define EPIPHANY_PER_CORE_REG_MEMPROTECT 0xF0608 82 #define EPIPHANY_PER_CORE_REG_DMA0CONFIG 0xF0500 83 #define EPIPHANY_PER_CORE_REG_DMA0STRIDE 0xF0504 84 #define EPIPHANY_PER_CORE_REG_DMA0COUNT 0xF0508 85 #define EPIPHANY_PER_CORE_REG_DMA0SRCADDR 0xF050C 86 #define EPIPHANY_PER_CORE_REG_DMA0DSTADDR 0xF0510 87 #define EPIPHANY_PER_CORE_REG_DMA0AUTO0 0xF0514 88 #define EPIPHANY_PER_CORE_REG_DMA0AUTO1 0xF0518 89 #define EPIPHANY_PER_CORE_REG_DMA0STATUS 0xF051C 90 #define EPIPHANY_PER_CORE_REG_DMA1CONFIG 0xF0520 91 #define EPIPHANY_PER_CORE_REG_DMA1STRIDE 0xF0524 92 #define EPIPHANY_PER_CORE_REG_DMA1COUNT 0xF0528 93 #define EPIPHANY_PER_CORE_REG_DMA1SRCADDR 0xF052C 94 #define EPIPHANY_PER_CORE_REG_DMA1DSTADDR 0xF0530 95 #define EPIPHANY_PER_CORE_REG_DMA1AUTO0 0xF0534 96 #define EPIPHANY_PER_CORE_REG_DMA1AUTO1 0xF0538 97 #define EPIPHANY_PER_CORE_REG_DMA1STATUS 0xF053C 100 #define EPIPHANY_PER_CORE_REG_MESHCONFIG 0xF0700 101 #define EPIPHANY_PER_CORE_REG_COREID 0xF0704 102 #define EPIPHANY_PER_CORE_REG_MULTICAST 0xF0708 103 #define EPIPHANY_PER_CORE_REG_CMESHROUTE 0xF0710 104 #define EPIPHANY_PER_CORE_REG_XMESHROUTE 0xF0714 105 #define EPIPHANY_PER_CORE_REG_RMESHROUTE 0xF0718 110 #define EPIPHANY_COREID_TO_MSB_ADDR(id) (id) << 20 115 #define EPIPHANY_GET_REG_ABSOLUTE_ADDR(coreid, reg) \ 116 (EPIPHANY_COREID_TO_MSB_ADDR(coreid) | (reg)) 118 #define EPIPHANY_REG(reg) (uint32_t *) (reg) 121 static inline uint32_t read_epiphany_reg(
volatile uint32_t reg_addr)
123 return *(EPIPHANY_REG(reg_addr));
127 static inline void write_epiphany_reg(
volatile uint32_t reg_addr, uint32_t val)
129 *(EPIPHANY_REG(reg_addr)) = val;
136 static const uint32_t
map[16] =
138 0x808, 0x809, 0x80A, 0x80B,
139 0x848, 0x849, 0x84A, 0x84B,
140 0x888, 0x889, 0x88A, 0x88B,
141 0x8C8, 0x8C9, 0x8CA, 0x8CB
144 static inline uint32_t rtems_coreid_to_epiphany_map(uint32_t
rtems_id)
153 static inline uint32_t epiphany_coreid_to_rtems_map(uint32_t epiphany_id)
155 register uint32_t coreid
asm (
"r17") = epiphany_id;
172 static inline uint32_t _Epiphany_Get_current_processor(
void)
176 asm volatile (
"movfs %0, coreid" :
"=r" (coreid): );
178 return epiphany_coreid_to_rtems_map(coreid);
register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__("g6")
The pointer to the current per-CPU control is available via register g6.
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83