arch/mips/include/asm/sn/sn0/addrs.h

Source file repositories/reference/linux-study-clean/arch/mips/include/asm/sn/sn0/addrs.h

File Facts

System
Linux kernel
Corpus path
arch/mips/include/asm/sn/sn0/addrs.h
Extension
.h
Size
9296 bytes
Lines
284
Domain
Architecture Layer
Bucket
arch/mips
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef _ASM_SN_SN0_ADDRS_H
#define _ASM_SN_SN0_ADDRS_H


/*
 * SN0 (on a T5) Address map
 *
 * This file contains a set of definitions and macros which are used
 * to reference into the major address spaces (CAC, HSPEC, IO, MSPEC,
 * and UNCAC) used by the SN0 architecture.  It also contains addresses
 * for "major" statically locatable PROM/Kernel data structures, such as
 * the partition table, the configuration data structure, etc.
 * We make an implicit assumption that the processor using this file
 * follows the R10K's provisions for specifying uncached attributes;
 * should this change, the base registers may very well become processor-
 * dependent.
 *
 * For more information on the address spaces, see the "Local Resources"
 * chapter of the Hub specification.
 *
 * NOTE: This header file is included both by C and by assembler source
 *	 files.	 Please bracket any language-dependent definitions
 *	 appropriately.
 */

/*
 * Some of the macros here need to be casted to appropriate types when used
 * from C.  They definitely must not be casted from assembly language so we
 * use some new ANSI preprocessor stuff to paste these on where needed.
 */

/*
 * The following couple of definitions will eventually need to be variables,
 * since the amount of address space assigned to each node depends on
 * whether the system is running in N-mode (more nodes with less memory)
 * or M-mode (fewer nodes with more memory).  We expect that it will
 * be a while before we need to make this decision dynamically, though,
 * so for now we just use defines bracketed by an ifdef.
 */

#ifdef CONFIG_SGI_SN_N_MODE

#define NODE_SIZE_BITS		31
#define BWIN_SIZE_BITS		28

#define NASID_BITS		9
#define NASID_BITMASK		(0x1ffLL)
#define NASID_SHFT		31
#define NASID_META_BITS		5
#define NASID_LOCAL_BITS	4

#define BDDIR_UPPER_MASK	(UINT64_CAST 0x7ffff << 10)
#define BDECC_UPPER_MASK	(UINT64_CAST 0x3ffffff << 3)

#else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */

#define NODE_SIZE_BITS		32
#define BWIN_SIZE_BITS		29

#define NASID_BITMASK		(0xffLL)
#define NASID_BITS		8
#define NASID_SHFT		32
#define NASID_META_BITS		4
#define NASID_LOCAL_BITS	4

#define BDDIR_UPPER_MASK	(UINT64_CAST 0xfffff << 10)
#define BDECC_UPPER_MASK	(UINT64_CAST 0x7ffffff << 3)

#endif /* !defined(CONFIG_SGI_SN_N_MODE) */

#define NODE_ADDRSPACE_SIZE	(UINT64_CAST 1 << NODE_SIZE_BITS)

#define NASID_MASK		(UINT64_CAST NASID_BITMASK << NASID_SHFT)
#define NASID_GET(_pa)		(int) ((UINT64_CAST (_pa) >>		\
					NASID_SHFT) & NASID_BITMASK)

#if !defined(__ASSEMBLER__)

#define NODE_SWIN_BASE(nasid, widget)					\
	((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN)		\
	: RAW_NODE_SWIN_BASE(nasid, widget))
#else /* __ASSEMBLER__ */
#define NODE_SWIN_BASE(nasid, widget) \
     (NODE_IO_BASE(nasid) + (UINT64_CAST(widget) << SWIN_SIZE_BITS))
#endif /* __ASSEMBLER__ */

/*
 * The following definitions pertain to the IO special address
 * space.  They define the location of the big and little windows
 * of any given node.

Annotation

Implementation Notes