Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/asm.h

    r3d6beaa rd99c1d2  
    3838#include <config.h>
    3939#include <typedefs.h>
    40 #include <arch/cpu.h>
    4140
    4241extern void asm_delay_loop(uint32_t t);
     
    270269        return v;
    271270}
    272 
    273 /** Check interrupts state.
    274  *
    275  * @return True if interrupts are disabled.
    276  *
    277  */
    278 static inline bool interrupts_disabled(void)
    279 {
    280         ipl_t v;
    281        
    282         asm volatile (
    283                 "pushfq\n"
    284                 "popq %[v]\n"
    285                 : [v] "=r" (v)
    286         );
    287        
    288         return ((v & RFLAGS_IF) == 0);
    289 }
    290 
    291271
    292272/** Write to MSR */
     
    330310                ::: "%eax","%ecx","%edx"
    331311        );
     312}
     313
     314static inline uintptr_t * get_ip()
     315{
     316        uintptr_t *ip;
     317       
     318        asm volatile (
     319                "mov %%rip, %[ip]"
     320                : [ip] "=r" (ip)
     321        );
     322       
     323        return ip;
    332324}
    333325
Note: See TracChangeset for help on using the changeset viewer.