Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch More inlined ASM. While here switch to proper types.



details:   https://anonhg.NetBSD.org/src/rev/1f799d7f189c
branches:  trunk
changeset: 998825:1f799d7f189c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat May 04 07:20:22 2019 +0000

description:
More inlined ASM. While here switch to proper types.

diffstat:

 sys/arch/amd64/amd64/cpufunc.S |  152 +--------------------------------
 sys/arch/i386/i386/cpufunc.S   |   35 +-------
 sys/arch/i386/i386/i386func.S  |  108 +----------------------
 sys/arch/x86/include/cpufunc.h |  189 +++++++++++++++++++++++++++++++++-------
 sys/arch/xen/x86/xenfunc.c     |   10 +-
 5 files changed, 165 insertions(+), 329 deletions(-)

diffs (truncated from 667 to 300 lines):

diff -r 0802680de120 -r 1f799d7f189c sys/arch/amd64/amd64/cpufunc.S
--- a/sys/arch/amd64/amd64/cpufunc.S    Sat May 04 04:54:15 2019 +0000
+++ b/sys/arch/amd64/amd64/cpufunc.S    Sat May 04 07:20:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.S,v 1.38 2019/05/01 15:17:49 maxv Exp $        */
+/*     $NetBSD: cpufunc.S,v 1.39 2019/05/04 07:20:22 maxv Exp $        */
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -88,58 +88,8 @@
        ltr     %di
        ret
 END(ltr)
-
-ENTRY(lcr0)
-       movq    %rdi, %cr0
-       ret
-END(lcr0)
-
-ENTRY(rcr0)
-       movq    %cr0, %rax
-       ret
-END(rcr0)
-
-ENTRY(lcr2)
-       movq    %rdi, %cr2
-       ret
-END(lcr2)
-
-ENTRY(rcr2)
-       movq    %cr2, %rax
-       ret
-END(rcr2)
-
-ENTRY(lcr3)
-       movq    %rdi, %cr3
-       ret
-END(lcr3)
-
-ENTRY(rcr3)
-       movq    %cr3, %rax
-       ret
-END(rcr3)
 #endif
 
-ENTRY(lcr4)
-       movq    %rdi, %cr4
-       ret
-END(lcr4)
-
-ENTRY(rcr4)
-       movq    %cr4, %rax
-       ret
-END(rcr4)
-
-ENTRY(lcr8)
-       movq    %rdi, %cr8
-       ret
-END(lcr8)
-
-ENTRY(rcr8)
-       movq    %cr8, %rax
-       ret
-END(rcr8)
-
 /*
  * Big hammer: flush all TLB entries, including ones from PTE's
  * with the G bit set.  This should only be necessary if TLB
@@ -177,76 +127,6 @@
        ret
 END(tlbflush)
 
-ENTRY(ldr0)
-       movq    %rdi, %dr0
-       ret
-END(ldr0)
-
-ENTRY(rdr0)
-       movq    %dr0, %rax
-       ret
-END(rdr0)
-
-ENTRY(ldr1)
-       movq    %rdi, %dr1
-       ret
-END(ldr1)
-
-ENTRY(rdr1)
-       movq    %dr1, %rax
-       ret
-END(rdr1)
-
-ENTRY(ldr2)
-       movq    %rdi, %dr2
-       ret
-END(ldr2)
-
-ENTRY(rdr2)
-       movq    %dr2, %rax
-       ret
-END(rdr2)
-
-ENTRY(ldr3)
-       movq    %rdi, %dr3
-       ret
-END(ldr3)
-
-ENTRY(rdr3)
-       movq    %dr3, %rax
-       ret
-END(rdr3)
-
-ENTRY(ldr6)
-       movq    %rdi, %dr6
-       ret
-END(ldr6)
-
-ENTRY(rdr6)
-       movq    %dr6, %rax
-       ret
-END(rdr6)
-
-ENTRY(ldr7)
-       movq    %rdi, %dr7
-       ret
-END(ldr7)
-
-ENTRY(rdr7)
-       movq    %dr7, %rax
-       ret
-END(rdr7)
-
-ENTRY(x86_disable_intr)
-       cli
-       ret
-END(x86_disable_intr)
-
-ENTRY(x86_enable_intr)
-       sti
-       ret
-END(x86_enable_intr)
-
 ENTRY(x86_read_flags)
        pushfq
        popq    %rax
@@ -469,21 +349,6 @@
        ret
 END(x86_cpuid2)
 
-ENTRY(x86_getss)
-       movl    %ss, %eax
-       ret
-END(x86_getss)
-
-ENTRY(fnclex)
-       fnclex
-       ret
-END(fnclex)
-
-ENTRY(fninit)
-       fninit
-       ret
-END(fninit)
-
 ENTRY(fnsave)
        fnsave  (%rdi)
        ret
@@ -664,21 +529,6 @@
        ret
 END(outsl)
 
-ENTRY(setds)
-       movw    %di, %ds
-       ret
-END(setds)
-
-ENTRY(setes)
-       movw    %di, %es
-       ret
-END(setes)
-
-ENTRY(setfs)
-       movw    %di, %fs
-       ret
-END(setfs)
-
 #ifndef XENPV
 ENTRY(setusergs)
        CLI(ax)
diff -r 0802680de120 -r 1f799d7f189c sys/arch/i386/i386/cpufunc.S
--- a/sys/arch/i386/i386/cpufunc.S      Sat May 04 04:54:15 2019 +0000
+++ b/sys/arch/i386/i386/cpufunc.S      Sat May 04 07:20:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.S,v 1.30 2019/05/01 15:17:49 maxv Exp $        */
+/*     $NetBSD: cpufunc.S,v 1.31 2019/05/04 07:20:22 maxv Exp $        */
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include <sys/errno.h>
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.30 2019/05/01 15:17:49 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.31 2019/05/04 07:20:22 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -73,22 +73,6 @@
 END(lidt)
 #endif /* XENPV */
 
-ENTRY(rcr3)
-       movl    %cr3, %eax
-       ret
-END(rcr3)
-
-ENTRY(lcr4)
-       movl    4(%esp), %eax
-       movl    %eax, %cr4
-       ret
-END(lcr4)
-
-ENTRY(rcr4)
-       movl    %cr4, %eax
-       ret
-END(rcr4)
-
 ENTRY(x86_read_flags)
        pushfl
        popl    %eax
@@ -276,21 +260,6 @@
        ret
 END(x86_cpuid2)
 
-ENTRY(x86_getss)
-       movl    %ss, %eax
-       ret
-END(x86_getss)
-
-ENTRY(fnclex)  
-       fnclex
-       ret
-END(fnclex)    
-
-ENTRY(fninit)
-       fninit
-       ret
-END(fninit)
-
 ENTRY(fnsave)
        movl    4(%esp), %eax
        fnsave  (%eax)
diff -r 0802680de120 -r 1f799d7f189c sys/arch/i386/i386/i386func.S
--- a/sys/arch/i386/i386/i386func.S     Sat May 04 04:54:15 2019 +0000
+++ b/sys/arch/i386/i386/i386func.S     Sat May 04 07:20:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386func.S,v 1.20 2019/01/06 14:35:31 cherry Exp $     */
+/*     $NetBSD: i386func.S,v 1.21 2019/05/04 07:20:22 maxv Exp $       */
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.20 2019/01/06 14:35:31 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386func.S,v 1.21 2019/05/04 07:20:22 maxv Exp $");
 
 #include <machine/specialreg.h>
 #include <machine/segments.h>
@@ -66,23 +66,6 @@
        ret
 END(ltr)
 
-ENTRY(lcr0)
-       movl    4(%esp), %eax
-       movl    %eax, %cr0
-       ret
-END(lcr0)
-
-ENTRY(rcr0)
-       movl    %cr0, %eax
-       ret
-END(rcr0)
-
-ENTRY(lcr3)
-       movl    4(%esp), %eax
-       movl    %eax, %cr3
-       ret
-END(lcr3)
-
 /*
  * Big hammer: flush all TLB entries, including ones from PTE's
  * with the G bit set.  This should only be necessary if TLB
@@ -123,98 +106,11 @@
        ret
 END(tlbflush)
 
-ENTRY(ldr0)
-       movl    4(%esp), %eax



Home | Main Index | Thread Index | Old Index