Deleted Added
full compact
cpu.h (204788) cpu.h (206717)
1/* $OpenBSD: cpu.h,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
2
3/*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell and Rick Macklem.

--- 27 unchanged lines hidden (view full) ---

36 * its documentation for any purpose and without fee is hereby granted,
37 * provided that the above copyright notice appears in all copies.
38 * Digital Equipment Corporation makes no representations about the
39 * suitability of this software for any purpose. It is provided "as is"
40 * without express or implied warranty.
41 *
42 * from: @(#)cpu.h 8.4 (Berkeley) 1/4/94
43 * JNPR: cpu.h,v 1.9.2.2 2007/09/10 08:23:46 girish
1/* $OpenBSD: cpu.h,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
2
3/*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell and Rick Macklem.

--- 27 unchanged lines hidden (view full) ---

36 * its documentation for any purpose and without fee is hereby granted,
37 * provided that the above copyright notice appears in all copies.
38 * Digital Equipment Corporation makes no representations about the
39 * suitability of this software for any purpose. It is provided "as is"
40 * without express or implied warranty.
41 *
42 * from: @(#)cpu.h 8.4 (Berkeley) 1/4/94
43 * JNPR: cpu.h,v 1.9.2.2 2007/09/10 08:23:46 girish
44 * $FreeBSD: head/sys/mips/include/cpu.h 204788 2010-03-06 05:45:49Z jmallett $
44 * $FreeBSD: head/sys/mips/include/cpu.h 206717 2010-04-17 01:17:31Z jmallett $
45 */
46
47#ifndef _MACHINE_CPU_H_
48#define _MACHINE_CPU_H_
49
45 */
46
47#ifndef _MACHINE_CPU_H_
48#define _MACHINE_CPU_H_
49
50#include <machine/psl.h>
51#include <machine/endian.h>
52
53#define MIPS_KSEG0_LARGEST_PHYS 0x20000000
54#define MIPS_PHYS_MASK (0x1fffffff)
55
56#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START)
57#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | MIPS_KSEG1_START)
58#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK)

--- 270 unchanged lines hidden (view full) ---

329 * definitions of cpu-dependent requirements
330 * referenced in generic code
331 */
332#define COPY_SIGCODE /* copy sigcode above user stack in exec */
333
334#define cpu_swapout(p) panic("cpu_swapout: can't get here");
335
336#ifndef _LOCORE
50#include <machine/endian.h>
51
52#define MIPS_KSEG0_LARGEST_PHYS 0x20000000
53#define MIPS_PHYS_MASK (0x1fffffff)
54
55#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START)
56#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | MIPS_KSEG1_START)
57#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK)

--- 270 unchanged lines hidden (view full) ---

328 * definitions of cpu-dependent requirements
329 * referenced in generic code
330 */
331#define COPY_SIGCODE /* copy sigcode above user stack in exec */
332
333#define cpu_swapout(p) panic("cpu_swapout: can't get here");
334
335#ifndef _LOCORE
336#include <machine/cpufunc.h>
337#include <machine/frame.h>
338/*
339 * Arguments to hardclock and gatherstats encapsulate the previous
340 * machine state in an opaque clockframe.
341 */
342#define clockframe trapframe /* Use normal trap frame */
343
344#define CLKF_USERMODE(framep) ((framep)->sr & SR_KSU_USER)
337#include <machine/frame.h>
338/*
339 * Arguments to hardclock and gatherstats encapsulate the previous
340 * machine state in an opaque clockframe.
341 */
342#define clockframe trapframe /* Use normal trap frame */
343
344#define CLKF_USERMODE(framep) ((framep)->sr & SR_KSU_USER)
345#define CLKF_BASEPRI(framep) ((framep)->cpl == 0)
346#define CLKF_PC(framep) ((framep)->pc)
347#define CLKF_INTR(framep) (0)
348#define MIPS_CLKF_INTR() (intr_nesting_level >= 1)
349#define TRAPF_USERMODE(framep) (((framep)->sr & SR_KSU_USER) != 0)
350#define TRAPF_PC(framep) ((framep)->pc)
351#define cpu_getstack(td) ((td)->td_frame->sp)
352
353/*
345#define CLKF_PC(framep) ((framep)->pc)
346#define CLKF_INTR(framep) (0)
347#define MIPS_CLKF_INTR() (intr_nesting_level >= 1)
348#define TRAPF_USERMODE(framep) (((framep)->sr & SR_KSU_USER) != 0)
349#define TRAPF_PC(framep) ((framep)->pc)
350#define cpu_getstack(td) ((td)->td_frame->sp)
351
352/*
353 * A machine-independent interface to the CPU's counter.
354 */
355#define get_cyclecount() mips_rd_count()
356
357/*
354 * CPU identification, from PRID register.
355 */
356union cpuprid {
357 int cpuprid;
358 struct {
359#if BYTE_ORDER == BIG_ENDIAN
360 u_int pad1:8; /* reserved */
361 u_int cp_vendor:8; /* company identifier */

--- 175 unchanged lines hidden (view full) ---

537#define IN_INT_HANDLER() \
538 (curthread->td_intr_nesting_level != 0 || \
539 (curthread->td_pflags & TDP_ITHREAD))
540
541/*
542 * Low level access routines to CPU registers
543 */
544
358 * CPU identification, from PRID register.
359 */
360union cpuprid {
361 int cpuprid;
362 struct {
363#if BYTE_ORDER == BIG_ENDIAN
364 u_int pad1:8; /* reserved */
365 u_int cp_vendor:8; /* company identifier */

--- 175 unchanged lines hidden (view full) ---

541#define IN_INT_HANDLER() \
542 (curthread->td_intr_nesting_level != 0 || \
543 (curthread->td_pflags & TDP_ITHREAD))
544
545/*
546 * Low level access routines to CPU registers
547 */
548
545void setsoftintr0(void);
546void clearsoftintr0(void);
547void setsoftintr1(void);
548void clearsoftintr1(void);
549
550
551u_int32_t mips_cp0_status_read(void);
552void mips_cp0_status_write(u_int32_t);
553
554int disableintr(void);
555void restoreintr(int);
556int enableintr(void);
557int Mips_TLBGetPID(void);
558
559void swi_vm(void *);
560void cpu_halt(void);
561void cpu_reset(void);
562
563u_int32_t set_intr_mask(u_int32_t);
564u_int32_t get_intr_mask(void);
549int Mips_TLBGetPID(void);
550
551void swi_vm(void *);
552void cpu_halt(void);
553void cpu_reset(void);
554
555u_int32_t set_intr_mask(u_int32_t);
556u_int32_t get_intr_mask(void);
565u_int32_t get_cyclecount(void);
566
567#define cpu_spinwait() /* nothing */
568
569#endif /* _KERNEL */
570#endif /* !_MACHINE_CPU_H_ */
557
558#define cpu_spinwait() /* nothing */
559
560#endif /* _KERNEL */
561#endif /* !_MACHINE_CPU_H_ */