.global _start _start: # Invalidate i$, d$ mov r5, 1 sr r5, [0x10] mov r5, 1 sr r5, [0x47] lr r2, [4] mov r1, 0x0000FF00 and r3, r2, r1 asr_s r3, r3, 1 # r3 == (aux(ARC_IDENTITY) & 0x0000FF00) << 7 mov r0, 0xD0000000 add_s r0, r0, r3 mov r1, 0x12345678 # Write test pattern st r1, [r0] st r2, [r0, 0x4] # Flush entire D$ mov r5, 1 sr r5, [0x4B] # Wait for flush operation to complete flush_wait: lr r5, [0x48] bbit1 r5, 0x8, flush_wait # Check status of the data-cache flush # Write test pattern bypassing caches. # **NEVER** use such code! It blows your whole leg off. # We use it only to make multicore test app as small as possible st.di r1, [r0] st.di r2, [r0, 0x4] nop nop nop flag 1