source: mainline/kernel/arch/ppc32/include/mm/tlb.h@ c39544a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since c39544a was 5954241, checked in by Martin Decky <martin@…>, 15 years ago

fix exception handler prototypes

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * Copyright (c) 2006 Martin Decky
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 ppc32mm
30 * @{
31 */
32/** @file
33 */
34
35#ifndef KERN_ppc32_TLB_H_
36#define KERN_ppc32_TLB_H_
37
38#include <arch/interrupt.h>
39#include <typedefs.h>
40
41#define WIMG_GUARDED 0x01
42#define WIMG_COHERENT 0x02
43#define WIMG_NO_CACHE 0x04
44#define WIMG_WRITETHRU 0x08
45
46typedef struct {
47 unsigned int v : 1; /**< Valid */
48 unsigned int vsid : 24; /**< Virtual Segment ID */
49 unsigned int h : 1; /**< Primary/secondary hash */
50 unsigned int api : 6; /**< Abbreviated Page Index */
51 unsigned int rpn : 20; /**< Real Page Number */
52 unsigned int reserved0 : 3;
53 unsigned int r : 1; /**< Reference */
54 unsigned int c : 1; /**< Change */
55 unsigned int wimg : 4; /**< Access control */
56 unsigned int reserved1 : 1;
57 unsigned int pp : 2; /**< Page protection */
58} phte_t;
59
60typedef struct {
61 unsigned int v : 1;
62 unsigned int vsid : 24;
63 unsigned int reserved0 : 1;
64 unsigned int api : 6;
65} ptehi_t;
66
67typedef struct {
68 unsigned int rpn : 20;
69 unsigned int xpn : 3;
70 unsigned int reserved0 : 1;
71 unsigned int c : 1;
72 unsigned int wimg : 4;
73 unsigned int x : 1;
74 unsigned int pp : 2;
75} ptelo_t;
76
77extern void pht_init(void);
78extern void pht_refill(unsigned int, istate_t *);
79
80extern bool pht_refill_real(unsigned int, istate_t *)
81 __attribute__ ((section("K_UNMAPPED_TEXT_START")));
82extern void tlb_refill_real(unsigned int, uint32_t, ptehi_t, ptelo_t,
83 istate_t *) __attribute__ ((section("K_UNMAPPED_TEXT_START")));
84
85#endif
86
87/** @}
88 */
Note: See TracBrowser for help on using the repository browser.