Changeset f2ef7fd in mainline for kernel/arch/ia32/include


Ignore:
Timestamp:
2008-10-05T21:20:13Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6198611
Parents:
1d132ae
Message:

Support for SYSENTER on ia32.

Location:
kernel/arch/ia32/include
Files:
1 added
2 edited

Legend:

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

    r1d132ae rf2ef7fd  
    248248}
    249249
     250/** Write to MSR */
     251static inline void write_msr(uint32_t msr, uint64_t value)
     252{
     253        asm volatile ("wrmsr" : : "c" (msr), "a" ((uint32_t)(value)),
     254            "d" ((uint32_t)(value >> 32)));
     255}
     256
     257static inline uint64_t read_msr(uint32_t msr)
     258{
     259        uint32_t ax, dx;
     260
     261        asm volatile ("rdmsr" : "=a"(ax), "=d"(dx) : "c" (msr));
     262        return ((uint64_t)dx << 32) | ax;
     263}
     264
     265
    250266/** Return base address of current stack
    251267 *
  • kernel/arch/ia32/include/cpu.h

    r1d132ae rf2ef7fd  
    3636#define KERN_ia32_CPU_H_
    3737
     38#define EFLAGS_IF       (1 << 9)
     39#define EFLAGS_RF       (1 << 16)
     40
     41#define CR4_OSFXSR_MASK (1<<9)
     42
     43/* Support for SYSENTER and SYSEXIT */
     44#define IA32_MSR_SYSENTER_CS    0x174
     45#define IA32_MSR_SYSENTER_ESP   0x175
     46#define IA32_MSR_SYSENTER_EIP   0x176
     47
     48#ifndef __ASM__
     49
    3850#include <arch/pm.h>
    3951#include <arch/asm.h>
    40 
    41 #define EFLAGS_IF       (1 << 9)
    42 #define EFLAGS_RF       (1 << 16)
    4352
    4453typedef struct {
     
    5261} cpu_arch_t;
    5362
    54 
    55 #define CR4_OSFXSR_MASK (1<<9)
     63#endif
    5664
    5765#endif
Note: See TracChangeset for help on using the changeset viewer.