Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 586cd56 in mainline


Ignore:
Timestamp:
2009-08-08T10:29:36Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
8688a6e
Parents:
9732e98
Message:

Use the RFLAGS defines instead of magic numbers.

Location:
kernel/arch/amd64
Files:
2 edited

Legend:

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

    r9732e98 r586cd56  
    3636#define KERN_amd64_CPU_H_
    3737
    38 #define RFLAGS_IF  (1 << 9)
    39 #define RFLAGS_DF  (1 << 10)
    40 #define RFLAGS_RF  (1 << 16)
     38#define RFLAGS_CF       (1 << 0)
     39#define RFLAGS_PF       (1 << 2)
     40#define RFLAGS_AF       (1 << 4)
     41#define RFLAGS_ZF       (1 << 6)
     42#define RFLAGS_SF       (1 << 7)
     43#define RFLAGS_TF       (1 << 8)
     44#define RFLAGS_IF       (1 << 9)
     45#define RFLAGS_DF       (1 << 10)
     46#define RFLAGS_OF       (1 << 11)
     47#define RFLAGS_RF       (1 << 16)
    4148
    4249#define EFER_MSR_NUM    0xc0000080
  • kernel/arch/amd64/src/userspace.c

    r9732e98 r586cd56  
    3434
    3535#include <userspace.h>
     36#include <arch/cpu.h>
    3637#include <arch/pm.h>
    3738#include <arch/types.h>
     
    5051        ipl_t ipl = interrupts_disable();
    5152       
    52         /* Clear CF, PF, AF, ZF, SF, DF, OF */
    53         ipl &= ~(0xcd4);
     53        ipl &= ~(RFLAGS_CF | RFLAGS_PF | RFLAGS_AF | RFLAGS_ZF | RFLAGS_SF |
     54            RFLAGS_DF | RFLAGS_OF);
    5455       
    5556        asm volatile (
Note: See TracChangeset for help on using the changeset viewer.