10897e314SAlex Smith /* 20897e314SAlex Smith * Copyright 2012, Alex Smith, alex@alex-smith.me.uk. 30897e314SAlex Smith * Distributed under the terms of the MIT License. 40897e314SAlex Smith */ 50897e314SAlex Smith #ifndef _KERNEL_ARCH_X86_64_IFRAME_H 60897e314SAlex Smith #define _KERNEL_ARCH_X86_64_IFRAME_H 70897e314SAlex Smith 80897e314SAlex Smith 90897e314SAlex Smith struct iframe { 100897e314SAlex Smith uint64 type; 11*396b7422SPaweł Dziepak void* fpu; 120897e314SAlex Smith uint64 r15; 130897e314SAlex Smith uint64 r14; 140897e314SAlex Smith uint64 r13; 150897e314SAlex Smith uint64 r12; 160897e314SAlex Smith uint64 r11; 170897e314SAlex Smith uint64 r10; 180897e314SAlex Smith uint64 r9; 190897e314SAlex Smith uint64 r8; 20b5c9d24aSAlex Smith uint64 bp; 21b5c9d24aSAlex Smith uint64 si; 22b5c9d24aSAlex Smith uint64 di; 23b5c9d24aSAlex Smith uint64 dx; 24b5c9d24aSAlex Smith uint64 cx; 25b5c9d24aSAlex Smith uint64 bx; 26b5c9d24aSAlex Smith uint64 ax; 27cc30eec4SAlex Smith uint64 orig_rax; 280897e314SAlex Smith uint64 vector; 290897e314SAlex Smith uint64 error_code; 30b5c9d24aSAlex Smith uint64 ip; 310897e314SAlex Smith uint64 cs; 320897e314SAlex Smith uint64 flags; 330897e314SAlex Smith 34bcb07a31SAlex Smith // SP and SS are unconditionally present on x86_64, make both names 35bcb07a31SAlex Smith // available. 36bcb07a31SAlex Smith union { 37bcb07a31SAlex Smith uint64 sp; 38b5c9d24aSAlex Smith uint64 user_sp; 39bcb07a31SAlex Smith }; 40bcb07a31SAlex Smith union { 41bcb07a31SAlex Smith uint64 ss; 420897e314SAlex Smith uint64 user_ss; 43bcb07a31SAlex Smith }; 440897e314SAlex Smith } _PACKED; 450897e314SAlex Smith 460897e314SAlex Smith #define IFRAME_IS_USER(f) (((f)->cs & DPL_USER) == DPL_USER) 470897e314SAlex Smith 480897e314SAlex Smith 490897e314SAlex Smith #endif /* _KERNEL_ARCH_X86_64_IFRAME_H */ 50