pcpu.h revision 91613
180708Sjake/*- 281763Sobrien * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> 380708Sjake * All rights reserved. 480708Sjake * 580708Sjake * Redistribution and use in source and binary forms, with or without 680708Sjake * modification, are permitted provided that the following conditions 780708Sjake * are met: 880708Sjake * 1. Redistributions of source code must retain the above copyright 980708Sjake * notice, this list of conditions and the following disclaimer. 1080708Sjake * 2. Redistributions in binary form must reproduce the above copyright 1180708Sjake * notice, this list of conditions and the following disclaimer in the 1280708Sjake * documentation and/or other materials provided with the distribution. 1380708Sjake * 1481334Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1580708Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1680708Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1781334Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1880708Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1980708Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2080708Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2180708Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2280708Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2380708Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2480708Sjake * SUCH DAMAGE. 2580708Sjake * 2682905Sjake * from: FreeBSD: src/sys/i386/include/globaldata.h,v 1.27 2001/04/27 2780708Sjake * $FreeBSD: head/sys/sparc64/include/pcpu.h 91613 2002-03-04 05:20:29Z jake $ 2880708Sjake */ 2980708Sjake 3087702Sjhb#ifndef _MACHINE_PCPU_H_ 3187702Sjhb#define _MACHINE_PCPU_H_ 3280708Sjake 3381763Sobrien#ifdef _KERNEL 3480708Sjake 3589035Sjake#include <machine/asmacros.h> 3685232Sjake#include <machine/frame.h> 3785232Sjake#include <machine/intr_machdep.h> 3885232Sjake 3982905Sjake#define ALT_STACK_SIZE 128 4082905Sjake 4181763Sobrien/* 4281763Sobrien * Inside the kernel, the globally reserved register g7 is used to 4381763Sobrien * point at the globaldata structure. 4481763Sobrien */ 4587702Sjhb#define PCPU_MD_FIELDS \ 4689035Sjake struct intr_queue pc_iq; /* interrupt queue */ \ 4789035Sjake u_int pc_mid; \ 4891613Sjake u_int pc_tlb_ctx; \ 4991613Sjake u_int pc_tlb_ctx_max; \ 5091613Sjake u_int pc_tlb_ctx_min; \ 5187702Sjhb u_int pc_wp_insn; /* watch point support */ \ 5287702Sjhb u_long pc_wp_pstate; \ 5387702Sjhb u_long pc_wp_va; \ 5487702Sjhb int pc_wp_mask 5585232Sjake 5689035Sjakestruct pcb; 5787702Sjhbstruct pcpu; 5885232Sjake 5989035Sjakeregister struct pcb *curpcb __asm__(__XSTRING(PCB_REG)); 6089035Sjakeregister struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG)); 6180708Sjake 6287702Sjhb#define PCPU_GET(member) (pcpup->pc_ ## member) 6387702Sjhb#define PCPU_PTR(member) (&pcpup->pc_ ## member) 6487702Sjhb#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) 6587702Sjhb 6681763Sobrien#endif /* _KERNEL */ 6781763Sobrien 6887702Sjhb#endif /* !_MACHINE_PCPU_H_ */ 69