Changeset 89344d85 in mainline for arch/amd64/src/asm_utils.S


Ignore:
Timestamp:
2005-09-03T00:19:23Z (19 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/src/asm_utils.S

    re4a6dda r89344d85  
    4040.global interrupt_handlers
    4141.global panic_printf
     42.global cpuid
    4243
    4344panic_printf:
     
    4748.global has_cpuid
    4849.global rdtsc
    49 
    50 
     50.global read_efer_flag
     51.global set_efer_flag
     52       
    5153## Determine CPUID support
    5254#
     
    7173        ret
    7274
     75cpuid:
     76        movq %rbx, %r10  # we have to preserve rbx across function calls
     77
     78        movl %edi,%eax  # load the command into %eax
     79
     80        cpuid   
     81        movl %eax,0(%rsi)
     82        movl %ebx,4(%rsi)
     83        movl %ecx,8(%rsi)
     84        movl %edx,12(%rsi)
     85
     86        movq %r10, %rbx
     87        ret
    7388
    7489rdtsc:
     
    7691        rdtsc
    7792        ret
    78        
     93
     94set_efer_flag:
     95        movq $0xc0000080, %rcx
     96        rdmsr
     97        btsl %edi, %eax
     98        wrmsr
     99        ret
     100       
     101read_efer_flag:
     102        movq $0xc0000080, %rcx
     103        rdmsr
     104        ret             
    79105
    80106# Push all general purpose registers on stack except %rbp, %rsp
Note: See TracChangeset for help on using the changeset viewer.