diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2011-06-24 11:42:03 -0700 |
---|---|---|
committer | Ben Widawsky <ben@bwidawsk.net> | 2011-07-28 14:26:57 -0700 |
commit | 62873796c4a96554cc139e9aa49e25ce19cd65cd (patch) | |
tree | 94ec773aca3881e696bd6f1067ec16beb4056e9a /debugger/system_routine/test.g4a | |
parent | e39b13d7e4174ec50fd41d74fe8d3375c8ef2850 (diff) |
intel-gpu-tools/debugging: shader debugger
high level summary of the files:
* debug_rdata - get current state from debug registers. Helpful
when developing the debugger, and could serve some purpose in the
future.
* eudb - the debugger itself
* eviction_macro - generate the proper macro to flush the EU render
cache until I get control flow working
* pre_cpp - an evaluating c preprocesser like thing, to be used before
cpp
* sr - the system routine, exception handler which runs on the EU
* test - a very basic test system routine
* debug.h
Diffstat (limited to 'debugger/system_routine/test.g4a')
-rw-r--r-- | debugger/system_routine/test.g4a | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/debugger/system_routine/test.g4a b/debugger/system_routine/test.g4a new file mode 100644 index 00000000..e4296e01 --- /dev/null +++ b/debugger/system_routine/test.g4a @@ -0,0 +1,64 @@ +/* + * Copyright © 2011 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Ben Widawsky <ben@bwidawsk.net> + * + */ + +#include "debug.h" + +#define CR0_0_ME_STATE_CTRL (1 << 31) +#define CR0_0_BP_SUPPRESS (1 << 15) +#define CR0_0_SPF_EN (1 << 2) +#define CR0_0_ACC_DIS (1 << 1) +#define CR0_1_BES_CTRL (1 << 31) +#define CR0_1_HALT_CTRL (1 << 30) +#define CR0_1_SOFT_EXCEPTION_CTRL (1 << 29) +#define CR0_1_ILLGL_OP_STS (1 << 28) +#define CR0_1_STACK_OVRFLW_STS (1 << 27) + +#define CR0_0_ENTRY_UNMASK (CR0_0_SPF_EN | CR0_0_ACC_DIS) +// TODO: Need to fix this for non breakpoint case +#define CR0_1_ENTRY_UNMASK ~(CR0_1_BES_CTRL) +#define CR0_0_RETURN_MASK ~(CR0_0_ME_STATE_CTRL | CR0_0_SPF_EN | CR0_0_ACC_DIS) + +#ifndef SANDYBRIDGE + #error Only SandyBridge is supported +#endif + +/* Default flags for an instruction */ +#define FLAGS { ALIGN1, SWITCH, MASK_DISABLE, ACCWRCTRL} + +Enter: + nop; + + or (1) cr0.0 cr0.0 CR0_0_ENTRY_UNMASK:ud FLAGS; + + /* Clear breakpoint status */ + and (1) cr0.1 cr0.1 CR0_1_ENTRY_UNMASK:ud FLAGS; + + /* set breakpoint suppress this should be conditional on bes */ + or (1) cr0.0 cr0.0 CR0_0_BP_SUPPRESS:ud FLAGS; + + and (1) cr0.0 cr0.0 CR0_0_RETURN_MASK:ud FLAGS; + nop; |