Stefan Reinauer | a7163f1 | 2011-04-16 00:09:53 +0000 | [diff] [blame] | 1 | static 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 */ |
| 12 | struct cbfs_stage_restricted { |
| 13 | unsigned long compression; |
| 14 | unsigned long entry; // this is really 64bit, but properly endianized |
| 15 | }; |
| 16 | |
| 17 | static inline unsigned long findstage(char* target) |
| 18 | { |
| 19 | return ((struct cbfs_stage_restricted *)walkcbfs(target))->entry; |
| 20 | } |
| 21 | |
| 22 | static inline void call(unsigned long addr, unsigned long bist) |
| 23 | { |
| 24 | asm volatile ("jmp *%0\n\t" : : "r" (addr), "a" (bist)); |
| 25 | } |
| 26 | |