Open 173210 opened 9 years ago
Or use volatile, that will make it assembly as-is.
The problem is not asm. Those functions are not inline-expanded because they don't have static suffix. But once they get inline-expanded, arguments will be completely ignored.
int __attribute__((naked))
arm11_kernel_execute(int (*func)(void)) // <- This is the problem.
We have SVC function in C with attribute((naked)) and inline assembly.
But they are not safe because they can be inlined. If inlined, the arguments will be completely ignored! We don't have so many calls, so I suggest we remove those functions and write directly. For example: