This commit is contained in:
julianb0 2019-06-14 12:46:09 +02:00
parent d2911d6602
commit 49323d29a9
No known key found for this signature in database
GPG Key ID: 9C7ACF0C053FB8A1
2 changed files with 41 additions and 34 deletions

View File

@ -68,7 +68,7 @@ bool i_##name(ctx_t *ctx, acc_t *p1, acc_t *p2, ulong *r1, ulong *r2) \
#define CHK_SUPERV() \
do { \
if ((cr0 & UF) == 1) { \
if ((cr0 & UF) > 0) { \
_except(ctx, E_SYS, "Supervisor-only INSTR"); \
} \
} while (0)

View File

@ -1,6 +1,46 @@
// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// Register types
enum
{
GPR = 1 << 0, // General
CTL = 1 << 1, // Control
SEG = 1 << 2, // Segment
RES = 1 << 8, // Reserved for insternal use
SYS = 1 << 9, // Reserved for supervisor mode
};
// FLG register
enum
{
CF = 1 << 0, // Carry flag
OF = 1 << 1, // Overflow flag
ZF = 1 << 2, // Zero flag
SF = 1 << 3, // Sign flag
PF = 1 << 4, // Parity flag
DF = 1 << 5, // Direction flag
IF = 1 << 16, // Interrupts enable flag
};
// CR0 register
enum
{
UF = 1 << 15, // User-mode flag
};
struct reg_t
{
char *name;
char *desc;
char *conv;
ulong val;
ulong flags;
};
enum
{
INV,
@ -71,37 +111,4 @@ enum
NREGS
};
enum
{
GPR = 1 << 0, // General
CTL = 1 << 1, // Control
SEG = 1 << 2, // Segment
RES = 1 << 8, // Reserved for insternal use
SYS = 1 << 9, // Reserved for supervisor mode
};
// FLG register
enum
{
CF = 1 << 0, // Carry flag
OF = 1 << 1, // Overflow flag
ZF = 1 << 2, // Zero flag
SF = 1 << 3, // Sign flag
PF = 1 << 4, // Parity flag
DF = 1 << 5, // Direction flag
UF = 1 << 16, // User-mode flag
IF = 1 << 17, // Interrupts enable flag
};
struct reg_t
{
char *name;
char *desc;
char *conv;
ulong val;
ulong flags;
};