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

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

use [u]int{8|16|32|64}_t type definitions as detected by the autotool
replace direct usage of arch/types.h with typedefs.h

  • Property mode set to 100644
File size: 2.8 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 v : 1; /**< Valid */
48 unsigned vsid : 24; /**< Virtual Segment ID */
49 unsigned h : 1; /**< Primary/secondary hash */
50 unsigned api : 6; /**< Abbreviated Page Index */
51 unsigned rpn : 20; /**< Real Page Number */
52 unsigned reserved0 : 3;
53 unsigned r : 1; /**< Reference */
54 unsigned c : 1; /**< Change */
55 unsigned wimg : 4; /**< Access control */
56 unsigned reserved1 : 1;
57 unsigned pp : 2; /**< Page protection */
58} phte_t;
59
60typedef struct {
61 unsigned v : 1;
62 unsigned vsid : 24;
63 unsigned reserved0 : 1;
64 unsigned api : 6;
65} ptehi_t;
66
67typedef struct {
68 unsigned rpn : 20;
69 unsigned xpn : 3;
70 unsigned reserved0 : 1;
71 unsigned c : 1;
72 unsigned wimg : 4;
73 unsigned x : 1;
74 unsigned pp : 2;
75} ptelo_t;
76
77extern void pht_init(void);
78extern void pht_refill(int n, istate_t *istate);
79extern bool pht_refill_real(int n, istate_t *istate) __attribute__ ((section("K_UNMAPPED_TEXT_START")));
80extern void tlb_refill_real(int n, uint32_t tlbmiss, ptehi_t ptehi, ptelo_t ptelo, istate_t *istate) __attribute__ ((section("K_UNMAPPED_TEXT_START")));
81
82#endif
83
84/** @}
85 */
Note: See TracBrowser for help on using the repository browser.