Provide ucas for hppa.

This commit is contained in:
skrll 2009-05-08 10:12:55 +00:00
parent ec76129d54
commit 785840b34d
2 changed files with 55 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.17 2009/05/08 09:33:58 skrll Exp $ */
/* $NetBSD: intr.c,v 1.18 2009/05/08 10:12:55 skrll Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.17 2009/05/08 09:33:58 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.18 2009/05/08 10:12:55 skrll Exp $");
#define __MUTEX_PRIVATE
@ -378,6 +378,9 @@ hppa_intr(struct trapframe *frame)
struct hp700_int_reg *int_reg;
int hp700_intr_ipending_new(struct hp700_int_reg *, int);
extern char ucas_ras_start[];
extern char ucas_ras_end[];
#ifndef LOCKDEBUG
extern char mutex_enter_crit_start[];
extern char mutex_enter_crit_end[];
@ -405,6 +408,13 @@ hppa_intr(struct trapframe *frame)
((kmutex_t *)frame->tf_arg0)->mtx_owner = (uintptr_t)curlwp;
#endif
if (frame->tf_iisq_head == HPPA_SID_KERNEL &&
frame->tf_iioq_head >= (u_int)ucas_ras_start &&
frame->tf_iioq_head <= (u_int)ucas_ras_end) {
frame->tf_iioq_head = (u_int)ucas_ras_start;
frame->tf_iioq_tail = (u_int)ucas_ras_start + 4;
}
/*
* Read the CPU interrupt register and acknowledge
* all interrupts. Starting with this value, get

View File

@ -1,4 +1,4 @@
/* $NetBSD: copy.S,v 1.9 2009/04/30 07:01:27 skrll Exp $ */
/* $NetBSD: copy.S,v 1.10 2009/05/08 10:12:55 skrll Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -345,3 +345,45 @@ ENTRY(hppa_ktext_stb, HPPA_FRAME_SIZE)
b hppa_ktext_stw
copy %t2, %arg1
EXIT(hppa_ktext_stb)
STRONG_ALIAS(ucas_int,ucas_32)
STRONG_ALIAS(ucas_ptr,ucas_32)
.global ucas_ras_start
.global ucas_ras_end
/*
* Compare-and-swap the pointer in the user-space.
*
* int ucasword(volatile void *uptr, void *old, void *new, void *ret);
*/
LEAF_ENTRY(ucas_32)
ldil L%VM_MAXUSER_ADDRESS, %t1
comb,>>= %arg0, %t1, 1f
/* setup fault handler */
mfctl CR_CURLWP, %r31
ldw L_ADDR(%r31), %r31
ldil L%_copy_on_fault, %t2
ldo R%_copy_on_fault(%t2), %t2
stw %t2, PCB_ONFAULT+U_PCB(%r31)
ldw U_PCB+PCB_SPACE(%r31), %t1
mtsp %t1, %sr1
ucas_ras_start:
ldw 0(%sr1, %arg0), %t1
comb,<> %arg1, %t1, 2f
copy %t1,%ret0
ucas_ras_end:
stw %arg2, 0(%sr1, %arg0)
copy %arg1, %ret0
2:
stw %ret0, 0(%sr1, %arg3)
bv 0(%rp)
copy %r0, %ret0
1:
bv 0(%rp)
ldi -1, %ret0
EXIT(ucas_32)