asm-static-entry-1.c [plain text]
#include <stdio.h>
#include <stdint.h>
extern void abort();
#define FUNCPTR_TO_UINT(f) ((intptr_t)(&(f)))
static intptr_t DoAsmCodeTest_C();
static void flush_cache_line_c(unsigned long inCacheLine);
static void flush_cache_line_c_end();
asm void flush_cache_line_c(
register unsigned long inCacheLine)
{
dcbst 0, r3
sync
icbi 0, r3
isync
entry static flush_cache_line_c_end;
}
intptr_t
DoAsmCodeTest_C()
{
intptr_t mw_size = 0;
mw_size = FUNCPTR_TO_UINT(flush_cache_line_c);
mw_size = FUNCPTR_TO_UINT(flush_cache_line_c_end) - mw_size;
return mw_size;
}
int main()
{
if (DoAsmCodeTest_C() != 16)
abort();
return 0;
}