Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
/*-
|
2001-08-16 09:29:35 +00:00
|
|
|
* Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org>
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
2001-08-09 02:09:34 +00:00
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
2001-08-09 02:09:34 +00:00
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
2001-09-03 22:58:05 +00:00
|
|
|
* from: FreeBSD: src/sys/i386/include/globaldata.h,v 1.27 2001/04/27
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
2001-12-11 23:33:44 +00:00
|
|
|
#ifndef _MACHINE_PCPU_H_
|
|
|
|
#define _MACHINE_PCPU_H_
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
|
2001-08-16 09:29:35 +00:00
|
|
|
#ifdef _KERNEL
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
|
2002-01-08 04:40:13 +00:00
|
|
|
#include <machine/asmacros.h>
|
2001-10-20 15:57:09 +00:00
|
|
|
#include <machine/frame.h>
|
|
|
|
#include <machine/intr_machdep.h>
|
|
|
|
|
2001-09-03 22:58:05 +00:00
|
|
|
#define ALT_STACK_SIZE 128
|
|
|
|
|
2004-05-26 12:06:52 +00:00
|
|
|
struct pmap;
|
2002-03-04 07:12:36 +00:00
|
|
|
|
2001-08-16 09:29:35 +00:00
|
|
|
/*
|
|
|
|
* Inside the kernel, the globally reserved register g7 is used to
|
|
|
|
* point at the globaldata structure.
|
|
|
|
*/
|
2001-12-11 23:33:44 +00:00
|
|
|
#define PCPU_MD_FIELDS \
|
2002-05-25 02:39:28 +00:00
|
|
|
struct intr_request pc_irpool[IR_FREE]; \
|
|
|
|
struct intr_request *pc_irhead; \
|
|
|
|
struct intr_request **pc_irtail; \
|
|
|
|
struct intr_request *pc_irfree; \
|
2004-05-26 12:06:52 +00:00
|
|
|
struct pmap *pc_pmap; \
|
2002-03-04 07:12:36 +00:00
|
|
|
vm_offset_t pc_addr; \
|
2005-04-16 14:57:38 +00:00
|
|
|
u_long pc_tickref; \
|
|
|
|
u_long pc_tickadj; \
|
2002-01-08 04:40:13 +00:00
|
|
|
u_int pc_mid; \
|
2002-08-15 05:24:55 +00:00
|
|
|
u_int pc_node; \
|
2002-03-04 05:20:29 +00:00
|
|
|
u_int pc_tlb_ctx; \
|
|
|
|
u_int pc_tlb_ctx_max; \
|
2003-03-18 08:15:24 +00:00
|
|
|
u_int pc_tlb_ctx_min
|
2001-12-11 23:33:44 +00:00
|
|
|
|
2002-01-08 04:40:13 +00:00
|
|
|
struct pcb;
|
2001-12-11 23:33:44 +00:00
|
|
|
struct pcpu;
|
2001-09-03 22:58:05 +00:00
|
|
|
|
2002-01-08 04:40:13 +00:00
|
|
|
register struct pcb *curpcb __asm__(__XSTRING(PCB_REG));
|
|
|
|
register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG));
|
2001-10-20 15:57:09 +00:00
|
|
|
|
2001-12-11 23:33:44 +00:00
|
|
|
#define PCPU_GET(member) (pcpup->pc_ ## member)
|
2007-03-11 05:54:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX The implementation of this operation should be made atomic
|
|
|
|
* with respect to preemption.
|
|
|
|
*/
|
2007-06-04 21:38:48 +00:00
|
|
|
#define PCPU_ADD(member, value) (pcpup->pc_ ## member += (value))
|
|
|
|
#define PCPU_INC(member) PCPU_ADD(member, 1)
|
2001-12-11 23:33:44 +00:00
|
|
|
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
|
|
|
|
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
|
Add skeleton machine dependent headers and c files for a port of freebsd
to a new architecture. This is the base of the sparc64 port, but contains
limited machine dependent code, and can be used a base for ports. Included
are:
- standard machine dependent headers, tweaked for a 64 bit, big endian
architecture, including empty versions of all the machine dependent
structures
- a machine independent atomic.h, which can be used until a port has
support for interrupts and the operations really need to be atomic
- stub versions of all the machine dependent functions, which panic
when called and print out the name of the function that needs to
be implemented. functions which are normally in assembly files are
not included, but this should reduce the number of different undefined
references on the first few compiles from hundreds to 5 or 6
Given minimal startup code and console support it should be trivial to
make this compile and run the first few sysinits on almost any architecture.
Requested by: alfred, imp, jhb
2001-07-31 05:45:16 +00:00
|
|
|
|
2001-08-16 09:29:35 +00:00
|
|
|
#endif /* _KERNEL */
|
|
|
|
|
2001-12-11 23:33:44 +00:00
|
|
|
#endif /* !_MACHINE_PCPU_H_ */
|