sortix-mirror/sortix/x64/x64.cpp

50 lines
1.7 KiB
C++
Raw Normal View History

/*******************************************************************************
2011-08-05 12:25:00 +00:00
Copyright(C) Jonas 'Sortie' Termansen 2011.
2011-08-05 12:25:00 +00:00
This file is part of Sortix.
2011-08-05 12:25:00 +00:00
Sortix is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
2011-08-05 12:25:00 +00:00
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
2011-08-05 12:25:00 +00:00
You should have received a copy of the GNU General Public License along with
Sortix. If not, see <http://www.gnu.org/licenses/>.
2011-08-05 12:25:00 +00:00
x64/x64.cpp
CPU stuff for the x64 platform.
2011-08-05 12:25:00 +00:00
*******************************************************************************/
2011-08-05 12:25:00 +00:00
#include <sortix/kernel/platform.h>
2013-05-12 22:23:24 +00:00
#include <sortix/kernel/cpu.h>
#include <sortix/kernel/log.h>
2011-08-05 12:25:00 +00:00
namespace Sortix
{
namespace X64
{
void InterruptRegisters::LogRegisters() const
{
Log::PrintF("[cr2=0x%zx,ds=0x%zx,rdi=0x%zx,rsi=0x%zx,rbp=0x%zx,"
"rsp=0x%zx,rbx=0x%zx,rdx=0x%zx,rcx=0x%zx,rax=0x%zx,"
"r8=0x%zx,r9=0x%zx,r10=0x%zx,r11=0x%zx,r12=0x%zx,"
"r13=0x%zx,r14=0x%zx,r15=0x%zx,int_no=0x%zx,"
"err_code=0x%zx,rip=0x%zx,cs=0x%zx,rflags=0x%zx,"
"userrsp=0x%zx,ss=0x%zx]",
cr2, ds, rdi, rsi, rbp,
rsp, rbx, rdx, rcx, rax,
r8, r9, r10, r11, r12,
r13, r14, r15, int_no,
err_code, rip, cs, rflags,
userrsp, ss);
}
2011-08-05 12:25:00 +00:00
}
}