diff options
Diffstat (limited to 'debugger/eudb.h')
-rw-r--r-- | debugger/eudb.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/debugger/eudb.h b/debugger/eudb.h new file mode 100644 index 00000000..de5eee15 --- /dev/null +++ b/debugger/eudb.h @@ -0,0 +1,74 @@ +/* + * Copyright © 2011,2015 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. + */ + +#ifndef _EUDB_H_ +#define _EUDB_H_ + +#define EU_ATT 0x7810 +#define EU_ATT_CLR 0x7830 + +#define RSVD_EU -1 + +#define RSVD_THREAD -1 +#define RSVD_ID EUID(-1, -1, -1) + +/* + * This macro helps set up the table of mapping an <EU, thread> to an attention + * clear bit in the MMIO space. + * + * For GEN6, the docs are wrong about the attention clear bits. The clear bits + * are provided as part of the structure in case they change in future + * generations. + */ +#define EUID(eu, td, clear) \ + { .euid = eu, .tid = td, .reg = EU_ATT, .fd = -1, .clr = clear } +#define EUID2(eu, td, clear) \ + { .euid = eu, .tid = td, .reg = EU_ATT + 4, .fd = -1, .clr = clear } + + +enum { + EBAD_SHMEM, + EBAD_PROTOCOL, + EBAD_MAGIC, + EBAD_WRITE +}; + +struct debuggee { + const int euid; + const int tid; + int fd; + const int clr; + const uint32_t reg; +}; + +struct debugger { + struct debuggee *debuggees; + const int num_threads; + const int real_num_threads; + const int threads_per_eu; +}; + +extern struct debugger gen6_gt1; +extern struct debugger gen6_gt2; + +#endif |