Changeset 89344d85 in mainline for arch/amd64/include/cpuid.h


Ignore:
Timestamp:
2005-09-03T00:19:23Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36b209a
Parents:
e4a6dda
Message:

Changes, that were needed to make it work on Bochs.

  • We CAN use the NX bit in paging tables, but we have

to initialize the NXE bit in EFER register first.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/include/cpuid.h

    re4a6dda r89344d85  
    3232#include <arch/types.h>
    3333
     34#define AMD_CPUID_EXTENDED 0x80000001
     35#define AMD_EXT_NOEXECUTE    20
     36
    3437struct cpu_info {
    3538        __u32 cpuid_eax;
     
    4144extern int has_cpuid(void);
    4245
    43 static inline void cpuid(__u32 cmd, cpu_info_t *info)
    44 {
    45         __asm__ (
    46                 "movl %1, %eax"
    47                 "cpuid"
    48                 "movl %eax, 0(%0)"
    49                 "movl %ebx, 4(%0)"
    50                 "movl %ecx, 8(%0)"
    51                 "movl %edx, 12(%0)"
    52                 : "=m"(info)
    53                 : "r"(cmd)
    54                 : "%eax","%ebx","%ecx","%edx"
    55                 );
    56 }
     46extern void cpuid(__u32 cmd, cpu_info_t *info);
     47
    5748
    5849extern __u64 rdtsc(void);
Note: See TracChangeset for help on using the changeset viewer.