Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static inline unsigned long get_current(void)
- {
- unsigned long current;
- asm volatile (
- " movl %%esp, %%eax;"
- " andl %1, %%eax;"
- " movl (%%eax), %0;"
- : "=r" (current)
- : "i" (0xfffff000)
- );
- return current;
- }
- program.c: Assembler messages: program.c:455: Error: incorrect
- register `%rbx' used with `l' suffix
- asm volatile (
- " movq %1, %%rax
- " andq %%rsp, %%rax;" // We only care about lower bits.
- " movq (%%rax), %0;"
- : "=r" (current)
- : "i" (0xfffffffffffff000)
- : "rax" // Remember to mark any temporary registers modified in "clobber"
- );
- static inline unsigned long get_current(void)
- {
- unsigned register long current asm("sp");
- asm volatile ("" : "=r"(current));
- return (current & ~ (unsigned long)0xfff);
- }
- sp
- sp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement