blob: 635ff10fd6a32f4bed0c725bc9117b77180e0185 [file] [log] [blame]
Stefan Reinauera7163f12011-04-16 00:09:53 +00001static void *walkcbfs(char *target)
2{
3 void *entry;
4 asm volatile (
5 "mov $1f, %%esp\n\t"
6 "jmp walkcbfs_asm\n\t"
7 "1:\n\t" : "=a" (entry) : "S" (target) : "ebx", "ecx", "edi", "esp");
8 return entry;
9}
10
11/* just enough to support findstage. copied because the original version doesn't easily pass through romcc */
12struct cbfs_stage_restricted {
13 unsigned long compression;
14 unsigned long entry; // this is really 64bit, but properly endianized
15};
16
17static inline unsigned long findstage(char* target)
18{
19 return ((struct cbfs_stage_restricted *)walkcbfs(target))->entry;
20}
21
22static inline void call(unsigned long addr, unsigned long bist)
23{
24 asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist));
25}
26