From 6494817540d80210fdd4a09b2fe18ead32aa26da Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 5 Dec 2017 06:39:34 +0000 Subject: [PATCH] Add EFLAGS_* macros, get rid of some more magic numbers. git-svn-id: svn://kolibrios.org@7126 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/const.inc | 18 ++++++++++++++++++ kernel/trunk/init.inc | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index 2a55c3016..8c258dfa5 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -159,6 +159,24 @@ MXCSR_FZ equ 0x8000 MXCSR_INIT equ (MXCSR_IM+MXCSR_DM+MXCSR_ZM+MXCSR_OM+MXCSR_UM+MXCSR_PM) +EFLAGS_CF equ 0x000001 ; carry flag +EFLAGS_PF equ 0x000004 ; parity flag +EFLAGS_AF equ 0x000010 ; auxiliary flag +EFLAGS_ZF equ 0x000040 ; zero flag +EFLAGS_SF equ 0x000080 ; sign flag +EFLAGS_TF equ 0x000100 ; trap flag +EFLAGS_IF equ 0x000200 ; interrupt flag +EFLAGS_DF equ 0x000400 ; direction flag +EFLAGS_OF equ 0x000800 ; overflow flag +EFLAGS_IOPL equ 0x003000 ; i/o priviledge level +EFLAGS_NT equ 0x004000 ; nested task flag +EFLAGS_RF equ 0x010000 ; resume flag +EFLAGS_VM equ 0x020000 ; virtual 8086 mode flag +EFLAGS_AC equ 0x040000 ; alignment check flag +EFLAGS_VIF equ 0x080000 ; virtual interrupt flag +EFLAGS_VIP equ 0x100000 ; virtual interrupt pending +EFLAGS_ID equ 0x200000 ; id flag + IRQ_PIC equ 0 IRQ_APIC equ 1 diff --git a/kernel/trunk/init.inc b/kernel/trunk/init.inc index b3f70904d..37a8234ba 100644 --- a/kernel/trunk/init.inc +++ b/kernel/trunk/init.inc @@ -356,7 +356,7 @@ proc test_cpu pushfd pop eax mov ecx, eax - xor eax, 0x40000 + xor eax, EFLAGS_AC push eax popfd pushfd @@ -369,7 +369,7 @@ proc test_cpu mov [cpu_type], CPU_486 mov eax, ecx - xor eax, 0x200000 + xor eax, EFLAGS_ID push eax popfd pushfd