2013-07-10 09:26:01 -04:00
|
|
|
/*******************************************************************************
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
Copyright(C) Jonas 'Sortie' Termansen 2011.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
This file is part of Sortix.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04: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 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04: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 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04: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 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
x64/x64.cpp
|
|
|
|
CPU stuff for the x64 platform.
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-07-10 09:26:01 -04:00
|
|
|
*******************************************************************************/
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-09-23 07:55:58 -04:00
|
|
|
#include <sortix/kernel/platform.h>
|
2013-05-12 18:23:24 -04:00
|
|
|
#include <sortix/kernel/cpu.h>
|
2012-03-21 19:52:29 -04:00
|
|
|
#include <sortix/kernel/log.h>
|
2011-08-05 08:25:00 -04:00
|
|
|
|
|
|
|
namespace Sortix
|
|
|
|
{
|
|
|
|
namespace X64
|
|
|
|
{
|
2011-11-28 19:21:59 -05:00
|
|
|
void InterruptRegisters::LogRegisters() const
|
|
|
|
{
|
|
|
|
Log::PrintF("[cr2=0x%zx,ds=0x%zx,rdi=0x%zx,rsi=0x%zx,rbp=0x%zx,"
|
2013-06-15 10:57:16 -04:00
|
|
|
"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]",
|
2011-11-28 19:21:59 -05:00
|
|
|
cr2, ds, rdi, rsi, rbp,
|
2013-06-15 10:57:16 -04:00
|
|
|
rsp, rbx, rdx, rcx, rax,
|
|
|
|
r8, r9, r10, r11, r12,
|
|
|
|
r13, r14, r15, int_no,
|
|
|
|
err_code, rip, cs, rflags,
|
|
|
|
userrsp, ss);
|
2011-11-28 19:21:59 -05:00
|
|
|
}
|
2011-08-05 08:25:00 -04:00
|
|
|
}
|
|
|
|
}
|