You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
972 B
C

/* Copyright (C) 2021,2022 fef <owo@fef.moe>. All rights reserved. */
#pragma once
#ifndef _ARCH_INTERRUPT_H_
#error "This file is not meant to be included directly, use <arch/interrupt.h>"
#endif
/*
* XXX it's probably not necessary to declare this struct __packed and add
* paddings for the cs and ss members manually, because all members *should*
* get aligned to 8 bytes automatically. I'm absolutely not in the mood for
* verifying this right now tho, so we're playing it safe.
*/
/**
* @brief A hardware stack frame on amd64.
* I have no idea whether x86 people are actually calling it hardware stack
* frame tbh, this is just the (ARM) terminology i'm used to. Either way,
* this is what gets pushed to the stack automatically when entering an ISR.
*/
struct amd64_hw_frame {
u64 rip;
u16 cs; u16 _pad0; u32 _pad1;
u64 rflags;
/* unlike on i386, the amd64 *always* pushes %rsp and %ss */
u64 rsp;
u16 ss; u16 _pad2; u32 _pad3;
} __packed;