source: mainline/kernel/arch/sparc64/include/register.h@ 0030eef

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 0030eef was d99c1d2, checked in by Martin Decky <martin@…>, 16 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: 3.6 KB
RevLine 
[2cf87e50]1/*
[df4ed85]2 * Copyright (c) 2005 Jakub Jermar
[2cf87e50]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
[0ffa3ef5]29/** @addtogroup sparc64
[b45c443]30 * @{
31 */
32/** @file
33 */
34
[0ffa3ef5]35#ifndef KERN_sparc64_REGISTER_H_
36#define KERN_sparc64_REGISTER_H_
37
[63cda71]38#include <arch/regdef.h>
[d99c1d2]39#include <typedefs.h>
[2cf87e50]40
41/** Version Register. */
42union ver_reg {
[7f1c620]43 uint64_t value;
[2cf87e50]44 struct {
[7f1c620]45 uint16_t manuf; /**< Manufacturer code. */
46 uint16_t impl; /**< Implementation code. */
47 uint8_t mask; /**< Mask set revision. */
[2cf87e50]48 unsigned : 8;
[7f1c620]49 uint8_t maxtl;
[2cf87e50]50 unsigned : 3;
51 unsigned maxwin : 5;
52 } __attribute__ ((packed));
53};
54typedef union ver_reg ver_reg_t;
55
[75e1db0]56/** Processor State Register. */
57union pstate_reg {
[7f1c620]58 uint64_t value;
[75e1db0]59 struct {
[7f1c620]60 uint64_t : 52;
[75e1db0]61 unsigned ig : 1; /**< Interrupt Globals. */
62 unsigned mg : 1; /**< MMU Globals. */
63 unsigned cle : 1; /**< Current Little Endian. */
64 unsigned tle : 1; /**< Trap Little Endian. */
65 unsigned mm : 2; /**< Memory Model. */
66 unsigned red : 1; /**< RED state. */
67 unsigned pef : 1; /**< Enable floating-point. */
68 unsigned am : 1; /**< 32-bit Address Mask. */
69 unsigned priv : 1; /**< Privileged Mode. */
70 unsigned ie : 1; /**< Interrupt Enable. */
71 unsigned ag : 1; /**< Alternate Globals*/
72 } __attribute__ ((packed));
73};
74typedef union pstate_reg pstate_reg_t;
75
[096d11e5]76/** TICK Register. */
77union tick_reg {
[7f1c620]78 uint64_t value;
[096d11e5]79 struct {
80 unsigned npt : 1; /**< Non-privileged Trap enable. */
[7f1c620]81 uint64_t counter : 63; /**< Elapsed CPU clck cycle counter. */
[096d11e5]82 } __attribute__ ((packed));
83};
84typedef union tick_reg tick_reg_t;
85
86/** TICK_compare Register. */
87union tick_compare_reg {
[7f1c620]88 uint64_t value;
[096d11e5]89 struct {
[6eabb6e6]90 unsigned int_dis : 1; /**< TICK_INT interrupt disabled flag. */
[7f1c620]91 uint64_t tick_cmpr : 63; /**< Compare value for TICK interrupts. */
[096d11e5]92 } __attribute__ ((packed));
93};
94typedef union tick_compare_reg tick_compare_reg_t;
95
[39494010]96/** SOFTINT Register. */
97union softint_reg {
[7f1c620]98 uint64_t value;
[39494010]99 struct {
[7f1c620]100 uint64_t : 47;
[39494010]101 unsigned stick_int : 1;
102 unsigned int_level : 15;
103 unsigned tick_int : 1;
104 } __attribute__ ((packed));
105};
106typedef union softint_reg softint_reg_t;
107
[6eabb6e6]108/** Floating-point Registers State Register. */
109union fprs_reg {
110 uint64_t value;
111 struct {
112 uint64_t : 61;
113 unsigned fef : 1;
114 unsigned du : 1;
115 unsigned dl : 1;
116 } __attribute__ ((packed));
117};
118typedef union fprs_reg fprs_reg_t;
119
[2cf87e50]120#endif
[b45c443]121
[0ffa3ef5]122/** @}
123 */
Note: See TracBrowser for help on using the repository browser.