aboutsummaryrefslogtreecommitdiffstats
path: root/rmem.h
blob: 226ed285df77160c8a5060dd7b1a184cc5a2531d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef __RMEM_H
#define __RMEM_H

#include "compiler.h"

extern unsigned long __rmem_stop_addr;

static inline void __noreturn __rmem_stop(unsigned long pc)
{
	__rmem_stop_addr = pc;

	while (1)
		asm volatile(".inst	0xd50bb001");
}

static inline void __rmem_thread_start(void *fn)
{
	register void *x0 asm("x0") = fn;
	asm volatile(".inst	0xd50bb003" : "+r" (x0) :: "memory");
}

#endif /* __RMEM_H */