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.

45 lines
1.5 KiB
C

/* See the end of this file for copyright and license terms. */
#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;
/*
* This file is part of GayBSD.
* Copyright (c) 2021 fef <owo@fef.moe>.
*
* GayBSD is nonviolent software: you may only use, redistribute, and/or
* modify it under the terms of the Cooperative Nonviolent Public License
* (CNPL) as found in the LICENSE file in the source code root directory
* or at <https://git.pixie.town/thufie/npl-builder>; either version 7
* of the license, or (at your option) any later version.
*
* GayBSD comes with ABSOLUTELY NO WARRANTY, to the extent
* permitted by applicable law. See the CNPL for details.
*/