Raspberry Pi Bare Bones: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Roman (talk | contribs)
Line 103:
static inline void mmio_write(uint32_t reg, uint32_t data)
{
*(volatile uint32_t *ptr)reg = (uint32_t*) regdata;
asm volatile("str %[data], [%[reg]]" : : [reg]"r"(ptr), [data]"r"(data));
}
 
static inline uint32_t mmio_read(uint32_t reg)
{
uint32_treturn *ptr(volatile =uint32_t (uint32_t*)reg;
uint32_t data;
asm volatile("ldr %[data], [%[reg]]" : [data]"=r"(data) : [reg]"r"(ptr));
return data;
}
 
Line 260 ⟶ 256:
</source>
 
Note that the above code uses a few extensions and hence we build as the GNU version of C99.
 
== Linking the Kernel ==