Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10474
b: refs/heads/master
c: 896a375
h: refs/heads/master
v: v3
  • Loading branch information
Grant Grundler authored and Kyle McMartin committed Oct 22, 2005
1 parent 64438f8 commit ac38374
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 161 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2c1fe81df7471de9f7e2918877ac04ec9cde35f
refs/heads/master: 896a375623c3643a3f189353e7d4828c48a7fdf8
51 changes: 24 additions & 27 deletions trunk/arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* - save registers to kernel stack and handle in assembly or C */


#include <asm/psw.h>
#include <asm/assembly.h> /* for LDREG/STREG defines */
#include <asm/pgtable.h>
#include <asm/psw.h>
#include <asm/signal.h>
#include <asm/unistd.h>
#include <asm/thread_info.h>
Expand Down Expand Up @@ -67,19 +67,22 @@

/* Switch to virtual mapping, trashing only %r1 */
.macro virt_map
rsm PSW_SM_Q,%r0
tovirt_r1 %r29
mfsp %sr7, %r1
or,= %r0,%r1,%r0 /* Only save sr7 in sr3 if sr7 != 0 */
mtsp %r1, %sr3
/* pcxt_ssm_bug */
rsm PSW_SM_I, %r0 /* barrier for "Relied upon Translation */
mtsp %r0, %sr4
mtsp %r0, %sr5
mfsp %sr7, %r1
or,= %r0,%r1,%r0 /* Only save sr7 in sr3 if sr7 != 0 */
mtsp %r1, %sr3
tovirt_r1 %r29
load32 KERNEL_PSW, %r1

rsm PSW_SM_QUIET,%r0 /* second "heavy weight" ctl op */
mtsp %r0, %sr6
mtsp %r0, %sr7
load32 KERNEL_PSW, %r1
mtctl %r1, %cr22
mtctl %r0, %cr17 /* Clear IIASQ tail */
mtctl %r0, %cr17 /* Clear IIASQ head */
mtctl %r1, %ipsw
load32 4f, %r1
mtctl %r1, %cr18 /* Set IIAOQ tail */
ldo 4(%r1), %r1
Expand Down Expand Up @@ -888,9 +891,6 @@ _switch_to_ret:
* this way, then we will need to copy %sr3 in to PT_SR[3..7], and
* adjust IASQ[0..1].
*
* Note that the following code uses a "relied upon translation".
* See the parisc ACD for details. The ssm is necessary due to a
* PCXT bug.
*/

.align 4096
Expand Down Expand Up @@ -985,24 +985,19 @@ intr_restore:
rest_fp %r1
rest_general %r29

/* Create a "relied upon translation" PA 2.0 Arch. F-5 */
ssm 0,%r0
nop
nop
nop
nop
nop
nop
nop
/* inverse of virt_map */
pcxt_ssm_bug
rsm PSW_SM_QUIET,%r0 /* prepare for rfi */
tophys_r1 %r29
rsm (PSW_SM_Q|PSW_SM_P|PSW_SM_D|PSW_SM_I),%r0

/* Restore space id's and special cr's from PT_REGS
* structure pointed to by r29 */
* structure pointed to by r29
*/
rest_specials %r29

/* Important: Note that rest_stack restores r29
* last (we are using it)! It also restores r1 and r30. */
/* IMPORTANT: rest_stack restores r29 last (we are using it)!
* It also restores r1 and r30.
*/
rest_stack

rfi
Expand Down Expand Up @@ -1153,15 +1148,17 @@ intr_save:

CMPIB=,n 6,%r26,skip_save_ior

/* save_specials left ipsw value in r8 for us to test */

mfctl %cr20, %r16 /* isr */
nop /* serialize mfctl on PA 2.0 to avoid 4 cycle penalty */
mfctl %cr21, %r17 /* ior */


#ifdef __LP64__
/*
* If the interrupted code was running with W bit off (32 bit),
* clear the b bits (bits 0 & 1) in the ior.
* save_specials left ipsw value in r8 for us to test.
*/
extrd,u,*<> %r8,PSW_W_BIT,1,%r0
depdi 0,1,2,%r17
Expand Down Expand Up @@ -1487,10 +1484,10 @@ nadtlb_emulate:
add,l %r1,%r24,%r1 /* doesn't affect c/b bits */

nadtlb_nullify:
mfctl %cr22,%r8 /* Get ipsw */
mfctl %ipsw,%r8
ldil L%PSW_N,%r9
or %r8,%r9,%r8 /* Set PSW_N */
mtctl %r8,%cr22
mtctl %r8,%ipsw

rfir
nop
Expand Down
47 changes: 9 additions & 38 deletions trunk/arch/parisc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ stext_pdc_ret:
mtctl %r0,%cr12
mtctl %r0,%cr13

/* Prepare to RFI! Man all the cannons! */

/* Initialize the global data pointer */
loadgp

Expand Down Expand Up @@ -254,55 +252,28 @@ $is_pa20:
$install_iva:
mtctl %r10,%cr14

#ifdef __LP64__
b aligned_rfi
b aligned_rfi /* Prepare to RFI! Man all the cannons! */
nop

.align 256
.align 128
aligned_rfi:
ssm 0,0
nop /* 1 */
nop /* 2 */
nop /* 3 */
nop /* 4 */
nop /* 5 */
nop /* 6 */
nop /* 7 */
nop /* 8 */
#endif

#ifdef __LP64__ /* move to psw.h? */
#define PSW_BITS PSW_Q+PSW_I+PSW_D+PSW_P+PSW_R
#else
#define PSW_BITS PSW_SM_Q
#endif

$rfi:
/* turn off troublesome PSW bits */
rsm PSW_BITS,%r0
pcxt_ssm_bug

/* kernel PSW:
* - no interruptions except HPMC and TOC (which are handled by PDC)
* - Q bit set (IODC / PDC interruptions)
* - big-endian
* - virtually mapped
*/
load32 KERNEL_PSW,%r10
mtctl %r10,%ipsw
rsm PSW_SM_QUIET,%r0 /* off troublesome PSW bits */
/* Don't need NOPs, have 8 compliant insn before rfi */

/* Set the space pointers for the post-RFI world
** Clear the two-level IIA Space Queue, effectively setting
** Kernel space.
*/
mtctl %r0,%cr17 /* Clear IIASQ tail */
mtctl %r0,%cr17 /* Clear IIASQ head */

/* Load RFI target into PC queue */
mtctl %r11,%cr18 /* IIAOQ head */
ldo 4(%r11),%r11
mtctl %r11,%cr18 /* IIAOQ tail */

load32 KERNEL_PSW,%r10
mtctl %r10,%ipsw

/* Jump to hyperspace */
/* Jump through hyperspace to Virt Mode */
rfi
nop

Expand Down
Loading

0 comments on commit ac38374

Please sign in to comment.