source: mainline/kernel/arch/arm32/include/mm/page_fault.h@ ecd1a0a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since ecd1a0a was ecd1a0a, checked in by Jan Vesely <jano.vesely@…>, 13 years ago

arm32: Use FSR for data aborts on armv6+.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * Copyright (c) 2007 Pavel Jancik, Michal Kebrt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup arm32mm
30 * @{
31 */
32/** @file
33 * @brief Page fault related declarations.
34 */
35
36#ifndef KERN_arm32_PAGE_FAULT_H_
37#define KERN_arm32_PAGE_FAULT_H_
38
39#include <typedefs.h>
40
41
42/** Decribes CP15 "fault status register" (FSR).
43 *
44 * See ARM Architecture Reference Manual ch. B4.9.6 (pdf p.743).
45 */
46typedef union {
47 struct {
48 unsigned status : 4;
49 unsigned domain : 4;
50 unsigned zero : 1;
51 unsigned sbz0 : 1;
52 unsigned fs : 1; /**< armv6+ mandated, earlier IPLM. DEFINED */
53 unsigned wr : 1; /**< armv6+ only */
54 unsigned should_be_zero : 20;
55 } ATTRIBUTE_PACKED data;
56 struct {
57 unsigned status : 4;
58 unsigned sbz0 : 6;
59 unsigned fs : 1;
60 unsigned should_be_zero : 21;
61 } ATTRIBUTE_PACKED inst;
62 uint32_t raw;
63} fault_status_t;
64
65
66/** Simplified description of instruction code.
67 *
68 * @note Used for recognizing memory access instructions.
69 * @see ARM architecture reference (chapter 3.1)
70 */
71typedef struct {
72 unsigned dummy1 : 4;
73 unsigned bit4 : 1;
74 unsigned bits567 : 3;
75 unsigned dummy : 12;
76 unsigned access : 1;
77 unsigned opcode : 4;
78 unsigned type : 3;
79 unsigned condition : 4;
80} ATTRIBUTE_PACKED instruction_t;
81
82
83/** Help union used for casting pc register (uint_32_t) value into
84 * #instruction_t pointer.
85 */
86typedef union {
87 instruction_t *instr;
88 uint32_t pc;
89} instruction_union_t;
90
91extern void prefetch_abort(unsigned int, istate_t *);
92extern void data_abort(unsigned int, istate_t *);
93
94#endif
95
96/** @}
97 */
Note: See TracBrowser for help on using the repository browser.