dragon-nx32: Don't stuff uarea on switch to self
authorTormod Volden <debian.tormod@gmail.com>
Sun, 19 Apr 2015 16:43:44 +0000 (18:43 +0200)
committerAlan Cox <alan@linux.intel.com>
Sun, 19 Apr 2015 17:45:54 +0000 (18:45 +0100)
A little bit of optimization. More can be done on
the amount being copied over.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/platform-dragon-nx32/tricks.s

index d0a109d..85baf85 100644 (file)
@@ -91,6 +91,11 @@ _switchin:
        ; get process table - must be in already from switchout
        ; jsr map_kernel
        lda P_TAB__P_PAGE_OFFSET+1,x            ; LSB of 16-bit page no
+
+       ; if we are switching to the same process
+       cmpa U_DATA__U_PAGE+1
+       beq nostash
+
        jsr map_process_a
        
        ; fetch uarea from process memory
@@ -106,6 +111,7 @@ stashb      ldd ,x++
        ; get back kernel page so that we see process table
        jsr map_kernel
 
+nostash:
        ;puls x
        ldx _swapstack
         ; check u_data->u_ptab matches what we wanted