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.
35 lines
1.4 KiB
C
35 lines
1.4 KiB
C
/* See the end of this file for copyright and license terms. */
|
|
|
|
#include <arch/trap.h>
|
|
|
|
#include <gay/kprintf.h>
|
|
#include <gay/systm.h>
|
|
|
|
void print_regs(const struct amd64_trap_frame *ctx)
|
|
{
|
|
kprintf("RIP = %#x:%#016lx\n", ctx->hw_frame.cs, ctx->hw_frame.rip);
|
|
kprintf("RFLAGS = %#016lx\n", ctx->hw_frame.rflags);
|
|
kprintf("RAX = %#016lx RDI = %#016lx\n", ctx->rax, ctx->rdi);
|
|
kprintf("RBX = %#016lx RSI = %#016lx\n", ctx->rbx, ctx->rsi);
|
|
kprintf("RCX = %#016lx RSP = %#016lx\n", ctx->rcx, ctx->hw_frame.rsp);
|
|
kprintf("RDX = %#016lx RBP = %#016lx\n", ctx->rdx, ctx->rbp);
|
|
kprintf("R8 = %#016lx R12 = %#016lx\n", ctx->r8, ctx->r12);
|
|
kprintf("R9 = %#016lx R13 = %#016lx\n", ctx->r9, ctx->r13);
|
|
kprintf("R10 = %#016lx R14 = %#016lx\n", ctx->r10, ctx->r14);
|
|
kprintf("R11 = %#016lx R15 = %#016lx\n", ctx->r11, ctx->r15);
|
|
}
|
|
|
|
/*
|
|
* 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.
|
|
*/
|