haiku/headers/private/kernel/arch/x86/64/iframe.h
Alex Smith b5c9d24abc Implemented threading for x86_64.
* Thread creation and switching is working fine, however threads do not yet
  get interrupted because I've not implemented hardware interrupt handling
  yet (I'll do that next).
* I've made some changes to struct iframe: I've removed the e/r prefixes
  from the member names for both 32/64, so now they're just named ip, ax,
  bp, etc. This makes it easier to write code that works with both 32/64
  without having to deal with different iframe member names.
2012-07-09 16:43:01 +01:00

41 lines
705 B
C

/*
* Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_X86_64_IFRAME_H
#define _KERNEL_ARCH_X86_64_IFRAME_H
struct iframe {
uint64 type;
uint64 r15;
uint64 r14;
uint64 r13;
uint64 r12;
uint64 r11;
uint64 r10;
uint64 r9;
uint64 r8;
uint64 bp;
uint64 si;
uint64 di;
uint64 dx;
uint64 cx;
uint64 bx;
uint64 ax;
uint64 vector;
uint64 error_code;
uint64 ip;
uint64 cs;
uint64 flags;
// Only present when the iframe is a userland iframe (IFRAME_IS_USER()).
uint64 user_sp;
uint64 user_ss;
} _PACKED;
#define IFRAME_IS_USER(f) (((f)->cs & DPL_USER) == DPL_USER)
#endif /* _KERNEL_ARCH_X86_64_IFRAME_H */