⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 system.h

📁 Linux内核源代码 为压缩文件 是<<Linux内核>>一书中的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifndef _ASM_IA64_SYSTEM_H#define _ASM_IA64_SYSTEM_H/* * System defines. Note that this is included both from .c and .S * files, so it does only defines, not any C code.  This is based * on information published in the Processor Abstraction Layer * and the System Abstraction Layer manual. * * Copyright (C) 1998-2000 Hewlett-Packard Co * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com> * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> * Copyright (C) 1999 Don Dugger <don.dugger@intel.com> */#include <linux/config.h>#include <asm/page.h>#define KERNEL_START		(PAGE_OFFSET + 0x500000)/* * The following #defines must match with vmlinux.lds.S: */#define IVT_END_ADDR		(KERNEL_START + 0x8000)#define ZERO_PAGE_ADDR		(IVT_END_ADDR + 0*PAGE_SIZE)#define SWAPPER_PGD_ADDR	(IVT_END_ADDR + 1*PAGE_SIZE)#define GATE_ADDR		(0xa000000000000000 + PAGE_SIZE)#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC) \    || defined(CONFIG_ITANIUM_B0_SPECIFIC) || defined(CONFIG_ITANIUM_B1_SPECIFIC)  /* Workaround for Errata 97.  */# define IA64_SEMFIX_INSN	mf;# define IA64_SEMFIX	"mf;"#else# define IA64_SEMFIX_INSN# define IA64_SEMFIX	""#endif#ifndef __ASSEMBLY__#include <linux/kernel.h>#include <linux/types.h>struct pci_vector_struct {	__u16 bus;	/* PCI Bus number */	__u32 pci_id;	/* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */	__u8 pin;	/* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */	__u8 irq;	/* IRQ assigned */};extern struct ia64_boot_param {	__u64 command_line;		/* physical address of command line arguments */	__u64 efi_systab;		/* physical address of EFI system table */	__u64 efi_memmap;		/* physical address of EFI memory map */	__u64 efi_memmap_size;		/* size of EFI memory map */	__u64 efi_memdesc_size;		/* size of an EFI memory map descriptor */	__u32 efi_memdesc_version;	/* memory descriptor version */	struct {		__u16 num_cols;	/* number of columns on console output device */		__u16 num_rows;	/* number of rows on console output device */		__u16 orig_x;	/* cursor's x position */		__u16 orig_y;	/* cursor's y position */	} console_info;	__u16 num_pci_vectors;	/* number of ACPI derived PCI IRQ's*/	__u64 pci_vectors;	/* physical address of PCI data (pci_vector_struct)*/	__u64 fpswa;		/* physical address of the the fpswa interface */	__u64 initrd_start;	__u64 initrd_size;} ia64_boot_param;static inline voidia64_insn_group_barrier (void){	__asm__ __volatile__ (";;" ::: "memory");}/* * Macros to force memory ordering.  In these descriptions, "previous" * and "subsequent" refer to program order; "visible" means that all * architecturally visible effects of a memory access have occurred * (at a minimum, this means the memory has been read or written). * *   wmb():	Guarantees that all preceding stores to memory- *		like regions are visible before any subsequent *		stores and that all following stores will be *		visible only after all previous stores. *   rmb():	Like wmb(), but for reads. *   mb():	wmb()/rmb() combo, i.e., all previous memory *		accesses are visible before all subsequent *		accesses and vice versa.  This is also known as *		a "fence." * * Note: "mb()" and its variants cannot be used as a fence to order * accesses to memory mapped I/O registers.  For that, mf.a needs to * be used.  However, we don't want to always use mf.a because (a) * it's (presumably) much slower than mf and (b) mf.a is supported for * sequential memory pages only. */#define mb()	__asm__ __volatile__ ("mf" ::: "memory")#define rmb()	mb()#define wmb()	mb()#ifdef CONFIG_SMP# define smp_mb()	mb()# define smp_rmb()	rmb()# define smp_wmb()	wmb()#else# define smp_mb()	barrier()# define smp_rmb()	barrier()# define smp_wmb()	barrier()#endif/* * XXX check on these---I suspect what Linus really wants here is * acquire vs release semantics but we can't discuss this stuff with * Linus just yet.  Grrr... */#define set_mb(var, value)	do { (var) = (value); mb(); } while (0)#define set_wmb(var, value)	do { (var) = (value); mb(); } while (0)/* * The group barrier in front of the rsm & ssm are necessary to ensure * that none of the previous instructions in the same group are * affected by the rsm/ssm. *//* For spinlocks etc */#ifdef CONFIG_IA64_DEBUG_IRQ  extern unsigned long last_cli_ip;# define local_irq_save(x)								\do {											\	unsigned long ip, psr;								\											\	__asm__ __volatile__ ("mov %0=psr;; rsm psr.i;;" : "=r" (psr) :: "memory");	\	if (psr & (1UL << 14)) {							\		__asm__ ("mov %0=ip" : "=r"(ip));					\		last_cli_ip = ip;							\	}										\	(x) = psr;									\} while (0)# define local_irq_disable()								\do {											\	unsigned long ip, psr;								\											\	__asm__ __volatile__ ("mov %0=psr;; rsm psr.i;;" : "=r" (psr) :: "memory");	\	if (psr & (1UL << 14)) {							\		__asm__ ("mov %0=ip" : "=r"(ip));					\		last_cli_ip = ip;							\	}										\} while (0)# define local_irq_restore(x)						 \do {									 \	unsigned long ip, old_psr, psr = (x);				 \									 \	__asm__ __volatile__ (";;mov %0=psr; mov psr.l=%1;; srlz.d"	 \			      : "=&r" (old_psr) : "r" (psr) : "memory"); \	if ((old_psr & (1UL << 14)) && !(psr & (1UL << 14))) {		 \		__asm__ ("mov %0=ip" : "=r"(ip));			 \		last_cli_ip = ip;					 \	}								 \} while (0)#else /* !CONFIG_IA64_DEBUG_IRQ */  /* clearing of psr.i is implicitly serialized (visible by next insn) */# define local_irq_save(x)	__asm__ __volatile__ ("mov %0=psr;; rsm psr.i;;"	\						      : "=r" (x) :: "memory")# define local_irq_disable()	__asm__ __volatile__ (";; rsm psr.i;;" ::: "memory")/* (potentially) setting psr.i requires data serialization: */# define local_irq_restore(x)	__asm__ __volatile__ (";; mov psr.l=%0;; srlz.d"	\						      :: "r" (x) : "memory")#endif /* !CONFIG_IA64_DEBUG_IRQ */#define local_irq_enable()	__asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory")#define __cli()			local_irq_disable ()#define __save_flags(flags)	__asm__ __volatile__ ("mov %0=psr" : "=r" (flags) :: "memory")#define __save_and_cli(flags)	local_irq_save(flags)#define save_and_cli(flags)	__save_and_cli(flags)#ifdef CONFIG_IA64_SOFTSDV_HACKS/* * Yech.  SoftSDV has a slight probem with psr.i and itc/itm.  If * PSR.i = 0 and ITC == ITM, you don't get the timer tick posted.  So, * I'll check if ITC is larger than ITM here and reset if neccessary. * I may miss a tick to two. *  * Don't include asm/delay.h; it causes include loops that are * mind-numbingly hard to follow. */#define get_itc(x) __asm__ __volatile__("mov %0=ar.itc" : "=r"((x)) :: "memory")#define get_itm(x) __asm__ __volatile__("mov %0=cr.itm" : "=r"((x)) :: "memory")#define set_itm(x) __asm__ __volatile__("mov cr.itm=%0" :: "r"((x)) : "memory")#define __restore_flags(x)			\do {						\        unsigned long itc, itm;			\	local_irq_restore(x);			\        get_itc(itc);				\        get_itm(itm);				\        if (itc > itm)				\		set_itm(itc + 10);		\} while (0)#define __sti()					\do {						\	unsigned long itc, itm;			\	local_irq_enable();			\	get_itc(itc);				\	get_itm(itm);				\	if (itc > itm)				\		set_itm(itc + 10);		\} while (0)#else /* !CONFIG_IA64_SOFTSDV_HACKS */#define __sti()			local_irq_enable ()#define __restore_flags(flags)	local_irq_restore(flags)#endif /* !CONFIG_IA64_SOFTSDV_HACKS */#ifdef CONFIG_SMP  extern void __global_cli (void);  extern void __global_sti (void);  extern unsigned long __global_save_flags (void);  extern void __global_restore_flags (unsigned long);# define cli()			__global_cli()# define sti()			__global_sti()# define save_flags(flags)	((flags) = __global_save_flags())# define restore_flags(flags)	__global_restore_flags(flags)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -