Inline most of the remaining PALcode calls.
This commit is contained in:
parent
15be242b3a
commit
9f7d189f05
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pal.s,v 1.13 1999/11/30 00:42:46 thorpej Exp $ */
|
||||
/* $NetBSD: pal.s,v 1.14 1999/12/02 22:08:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
|
||||
|
@ -39,7 +39,7 @@
|
|||
* and Richard T. Witek.
|
||||
*/
|
||||
|
||||
__KERNEL_RCSID(1, "$NetBSD: pal.s,v 1.13 1999/11/30 00:42:46 thorpej Exp $");
|
||||
__KERNEL_RCSID(1, "$NetBSD: pal.s,v 1.14 1999/12/02 22:08:04 thorpej Exp $");
|
||||
|
||||
inc2: .stabs __FILE__,132,0,0,inc2; .loc 1 __LINE__
|
||||
/*
|
||||
|
@ -88,15 +88,6 @@ LEAF(alpha_pal_cflush,1)
|
|||
RET
|
||||
END(alpha_pal_cflush)
|
||||
|
||||
/*
|
||||
* alpha_pal_draina: Drain aborts. [PRIVILEGED]
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_draina,0)
|
||||
call_pal PAL_draina
|
||||
RET
|
||||
END(alpha_pal_draina)
|
||||
|
||||
/*
|
||||
* alpha_pal_halt: Halt the processor. [PRIVILEGED]
|
||||
*/
|
||||
|
@ -107,18 +98,6 @@ LEAF(alpha_pal_halt,0)
|
|||
RET
|
||||
END(alpha_pal_halt)
|
||||
|
||||
/*
|
||||
* alpha_pal_rdmces: Read MCES processor register. [PRIVILEGED]
|
||||
*
|
||||
* Return:
|
||||
* v0 current MCES value
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_rdmces,1)
|
||||
call_pal PAL_OSF1_rdmces
|
||||
RET
|
||||
END(alpha_pal_rdmces)
|
||||
|
||||
/*
|
||||
* alpha_pal_rdps: Read processor status. [PRIVILEGED]
|
||||
*
|
||||
|
@ -131,33 +110,6 @@ LEAF(alpha_pal_rdps,0)
|
|||
RET
|
||||
END(alpha_pal_rdps)
|
||||
|
||||
/*
|
||||
* alpha_pal_rdusp: Read user stack pointer. [PRIVILEGED]
|
||||
*
|
||||
* Return:
|
||||
* v0 current user stack pointer
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_rdusp,0)
|
||||
call_pal PAL_OSF1_rdusp
|
||||
RET
|
||||
END(alpha_pal_rdusp)
|
||||
|
||||
/*
|
||||
* alpha_pal_rdval: Read system value. [PRIVILEGED]
|
||||
*
|
||||
* Returns the sysvalue in v0, allowing access to a 64-bit
|
||||
* per-processor value for use by the operating system.
|
||||
*
|
||||
* Return:
|
||||
* v0 sysvalue
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_rdval,0)
|
||||
call_pal PAL_OSF1_rdval
|
||||
RET
|
||||
END(alpha_pal_rdval)
|
||||
|
||||
/*
|
||||
* alpha_pal_swpipl: Swap Interrupt priority level. [PRIVILEGED]
|
||||
* _alpha_pal_swpipl: Same, from profiling code. [PRIVILEGED]
|
||||
|
@ -192,45 +144,6 @@ LEAF(alpha_pal_wrent,2)
|
|||
RET
|
||||
END(alpha_pal_wrent)
|
||||
|
||||
/*
|
||||
* alpha_pal_wrfen: Write floating-point enable. [PRIVILEGED]
|
||||
*
|
||||
* Arguments:
|
||||
* a0 new enable value (val & 0x1 -> enable).
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_wrfen,1)
|
||||
call_pal PAL_OSF1_wrfen
|
||||
RET
|
||||
END(alpha_pal_wrfen)
|
||||
|
||||
/*
|
||||
* alpha_pal_wripir: Write interprocessor interrupt request. [PRIVILEGED]
|
||||
*
|
||||
* Generate an interprocessor interrupt on the processor specified by
|
||||
* processor number in a0.
|
||||
*
|
||||
* Arguments:
|
||||
* a0 processor to interrupt
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_wripir,1)
|
||||
call_pal PAL_ipir
|
||||
RET
|
||||
END(alpha_pal_wripir)
|
||||
|
||||
/*
|
||||
* alpha_pal_wrusp: Write user stack pointer. [PRIVILEGED]
|
||||
*
|
||||
* Arguments:
|
||||
* a0 new user stack pointer
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_wrusp,1)
|
||||
call_pal PAL_OSF1_wrusp
|
||||
RET
|
||||
END(alpha_pal_wrusp)
|
||||
|
||||
/*
|
||||
* alpha_pal_wrvptptr: Write virtual page table pointer. [PRIVILEGED]
|
||||
*
|
||||
|
@ -242,44 +155,3 @@ LEAF(alpha_pal_wrvptptr,1)
|
|||
call_pal PAL_OSF1_wrvptptr
|
||||
RET
|
||||
END(alpha_pal_wrvptptr)
|
||||
|
||||
/*
|
||||
* alpha_pal_wrmces: Write MCES processor register. [PRIVILEGED]
|
||||
*
|
||||
* Arguments:
|
||||
* a0 value to write to MCES
|
||||
*/
|
||||
.text
|
||||
LEAF(alpha_pal_wrmces,1)
|
||||
call_pal PAL_OSF1_wrmces
|
||||
RET
|
||||
END(alpha_pal_wrmces)
|
||||
|
||||
/*
|
||||
* alpha_pal_wrval: Write system value. [PRIVILEGED]
|
||||
*
|
||||
* Write the value passed in a0 to this processor's sysvalue.
|
||||
*
|
||||
* Arguments:
|
||||
* a0 value to write to sysvalue
|
||||
*/
|
||||
LEAF(alpha_pal_wrval,1)
|
||||
call_pal PAL_OSF1_wrval
|
||||
RET
|
||||
END(alpha_pal_wrval)
|
||||
|
||||
/*
|
||||
* alpha_pal_swpctx: Swap context. [PRIVILEGED]
|
||||
*
|
||||
* Switch to a new process context.
|
||||
*
|
||||
* Arguments:
|
||||
* a0 physical address of hardware PCB describing context
|
||||
*
|
||||
* Returns:
|
||||
* v0 physical address of hardware PCB describing previous context
|
||||
*/
|
||||
LEAF(alpha_pal_swpctx,1)
|
||||
call_pal PAL_OSF1_swpctx
|
||||
RET
|
||||
END(alpha_pal_swpctx)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: alpha_cpu.h,v 1.35 1999/12/02 19:41:40 thorpej Exp $ */
|
||||
/* $NetBSD: alpha_cpu.h,v 1.36 1999/12/02 22:08:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Carnegie-Mellon University.
|
||||
|
@ -335,39 +335,64 @@ alpha_rpcc()
|
|||
#include <machine/pal.h>
|
||||
|
||||
void alpha_pal_cflush __P((unsigned long));
|
||||
void alpha_pal_draina __P((void));
|
||||
void alpha_pal_halt __P((void)) __attribute__((__noreturn__));
|
||||
unsigned long alpha_pal_rdmces __P((void));
|
||||
unsigned long alpha_pal_rdusp __P((void));
|
||||
unsigned long alpha_pal_rdval __P((void));
|
||||
unsigned long alpha_pal_swpctx __P((unsigned long));
|
||||
unsigned long _alpha_pal_swpipl __P((unsigned long)); /* for profiling */
|
||||
void alpha_pal_wrent __P((void *, unsigned long));
|
||||
void alpha_pal_wrfen __P((unsigned long));
|
||||
void alpha_pal_wripir __P((unsigned long));
|
||||
void alpha_pal_wrusp __P((unsigned long));
|
||||
void alpha_pal_wrvptptr __P((unsigned long));
|
||||
void alpha_pal_wrmces __P((unsigned long));
|
||||
void alpha_pal_wrval __P((unsigned long));
|
||||
|
||||
static __inline unsigned long alpha_pal_rdmces __P((void))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_rdps __P((void))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_rdusp __P((void))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_rdval __P((void))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_swpctx __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_swpipl __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_tbi __P((unsigned long, vaddr_t))
|
||||
__attribute__((__unused__));
|
||||
static __inline unsigned long alpha_pal_whami __P((void))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_wrfen __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_wripir __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_wrusp __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_wrmces __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
static __inline void alpha_pal_wrval __P((unsigned long))
|
||||
__attribute__((__unused__));
|
||||
|
||||
#define alpha_pal_imb() __asm __volatile("call_pal %0" \
|
||||
#define alpha_pal_draina() __asm __volatile("call_pal %0 # PAL_draina" \
|
||||
: : "i" (PAL_draina) : "memory")
|
||||
|
||||
#define alpha_pal_imb() __asm __volatile("call_pal %0 # PAL_imb" \
|
||||
: : "i" (PAL_imb) : "memory")
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_rdmces()
|
||||
{
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_rdmces"
|
||||
: "=r" (v0)
|
||||
: "i" (PAL_OSF1_rdmces)
|
||||
/* clobbers t0, t8..t11 */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
|
||||
return (v0);
|
||||
}
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_rdps()
|
||||
{
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %1"
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_rdps"
|
||||
: "=r" (v0)
|
||||
: "i" (PAL_OSF1_rdps)
|
||||
/* clobbers t0, t8..t11 */
|
||||
|
@ -376,6 +401,50 @@ alpha_pal_rdps()
|
|||
return (v0);
|
||||
}
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_rdusp()
|
||||
{
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_rdusp"
|
||||
: "=r" (v0)
|
||||
: "i" (PAL_OSF1_rdusp)
|
||||
/* clobbers t0, t8..t11 */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
|
||||
return (v0);
|
||||
}
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_rdval()
|
||||
{
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_rdval"
|
||||
: "=r" (v0)
|
||||
: "i" (PAL_OSF1_rdval)
|
||||
/* clobbers t0, t8..t11 */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
|
||||
return (v0);
|
||||
}
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_swpctx(ctx)
|
||||
unsigned long ctx;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = ctx;
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %2 # PAL_OSF1_swpctx"
|
||||
: "=r" (a0), "=r" (v0)
|
||||
: "i" (PAL_OSF1_swpctx), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
|
||||
return (v0);
|
||||
}
|
||||
|
||||
static __inline unsigned long
|
||||
alpha_pal_swpipl(ipl)
|
||||
unsigned long ipl;
|
||||
|
@ -383,7 +452,7 @@ alpha_pal_swpipl(ipl)
|
|||
register unsigned long a0 __asm("$16") = ipl;
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %2"
|
||||
__asm __volatile("call_pal %2 # PAL_OSF1_swpipl"
|
||||
: "=r" (a0), "=r" (v0)
|
||||
: "i" (PAL_OSF1_swpipl), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
|
@ -400,7 +469,7 @@ alpha_pal_tbi(op, va)
|
|||
register unsigned long a0 __asm("$16") = op;
|
||||
register unsigned long a1 __asm("$17") = va;
|
||||
|
||||
__asm __volatile("call_pal %2"
|
||||
__asm __volatile("call_pal %2 # PAL_OSF1_tbi"
|
||||
: "=r" (a0), "=r" (a1)
|
||||
: "i" (PAL_OSF1_tbi), "0" (a0), "1" (a1)
|
||||
/* clobbers t0, t8..t11, a0 (above), a1 (above) */
|
||||
|
@ -412,7 +481,7 @@ alpha_pal_whami()
|
|||
{
|
||||
register unsigned long v0 __asm("$0");
|
||||
|
||||
__asm __volatile("call_pal %1"
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_whami"
|
||||
: "=r" (v0)
|
||||
: "i" (PAL_OSF1_whami)
|
||||
/* clobbers t0, t8..t11 */
|
||||
|
@ -421,4 +490,69 @@ alpha_pal_whami()
|
|||
return (v0);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
alpha_pal_wrfen(onoff)
|
||||
unsigned long onoff;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = onoff;
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_wrfen"
|
||||
: "=r" (a0)
|
||||
: "i" (PAL_OSF1_wrfen), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
}
|
||||
|
||||
static __inline void
|
||||
alpha_pal_wripir(cpu_id)
|
||||
unsigned long cpu_id;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = cpu_id;
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_ipir"
|
||||
: "=r" (a0)
|
||||
: "i" (PAL_ipir), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
}
|
||||
|
||||
static __inline void
|
||||
alpha_pal_wrusp(usp)
|
||||
unsigned long usp;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = usp;
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_wrusp"
|
||||
: "=r" (a0)
|
||||
: "i" (PAL_OSF1_wrusp), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
}
|
||||
|
||||
static __inline void
|
||||
alpha_pal_wrmces(mces)
|
||||
unsigned long mces;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = mces;
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_wrmces"
|
||||
: "=r" (a0)
|
||||
: "i" (PAL_OSF1_wrmces), "0" (a0)
|
||||
/* clobbers t0, t8..t11 */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
}
|
||||
|
||||
static __inline void
|
||||
alpha_pal_wrval(val)
|
||||
unsigned long val;
|
||||
{
|
||||
register unsigned long a0 __asm("$16") = val;
|
||||
|
||||
__asm __volatile("call_pal %1 # PAL_OSF1_wrval"
|
||||
: "=r" (a0)
|
||||
: "i" (PAL_OSF1_wrval), "0" (a0)
|
||||
/* clobbers t0, t8..t11, a0 (above) */
|
||||
: "$1", "$22", "$23", "$24", "$25");
|
||||
}
|
||||
|
||||
#endif /* __ALPHA_ALPHA_CPU_H__ */
|
||||
|
|
Loading…
Reference in New Issue