Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Remove unused functions and reorder a little.



details:   https://anonhg.NetBSD.org/src/rev/ed8278c0c846
branches:  trunk
changeset: 450969:ed8278c0c846
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed May 01 14:29:15 2019 +0000

description:
Remove unused functions and reorder a little.

diffstat:

 sys/arch/amd64/amd64/cpufunc.S |  29 +------------------
 sys/arch/i386/i386/cpufunc.S   |  29 +-----------------
 sys/arch/x86/include/cpufunc.h |  65 ++++++++++++++++++++++-------------------
 3 files changed, 38 insertions(+), 85 deletions(-)

diffs (274 lines):

diff -r 99a87614e98a -r ed8278c0c846 sys/arch/amd64/amd64/cpufunc.S
--- a/sys/arch/amd64/amd64/cpufunc.S    Wed May 01 14:10:26 2019 +0000
+++ b/sys/arch/amd64/amd64/cpufunc.S    Wed May 01 14:29:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.S,v 1.36 2019/02/11 14:59:32 cherry Exp $      */
+/*     $NetBSD: cpufunc.S,v 1.37 2019/05/01 14:29:15 maxv Exp $        */
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -374,15 +374,6 @@
        ret
 END(cpu_counter32)
 
-ENTRY(rdpmc)
-       movq    %rdi, %rcx
-       xorq    %rax, %rax
-       rdpmc
-       shlq    $32, %rdx
-       orq     %rdx, %rax
-       ret
-END(rdpmc)
-
 ENTRY(rdtsc)
        xorq    %rax,%rax
        rdtsc
@@ -531,11 +522,6 @@
        ret
 END(x86_getss)
 
-ENTRY(fldcw)
-       fldcw   (%rdi)
-       ret
-END(fldcw)
-
 ENTRY(fnclex)
        fnclex
        ret
@@ -566,24 +552,11 @@
        ret
 END(fnstsw)
 
-ENTRY(fp_divide_by_0)
-       fldz
-       fld1
-       fdiv    %st, %st(1)
-       fwait
-       ret
-END(fp_divide_by_0)
-
 ENTRY(frstor)
        frstor  (%rdi)
        ret
 END(frstor)
 
-ENTRY(fwait)
-       fwait
-       ret
-END(fwait)
-
 ENTRY(clts)
        clts
        ret
diff -r 99a87614e98a -r ed8278c0c846 sys/arch/i386/i386/cpufunc.S
--- a/sys/arch/i386/i386/cpufunc.S      Wed May 01 14:10:26 2019 +0000
+++ b/sys/arch/i386/i386/cpufunc.S      Wed May 01 14:29:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc.S,v 1.28 2019/02/11 14:59:32 cherry Exp $      */
+/*     $NetBSD: cpufunc.S,v 1.29 2019/05/01 14:29:15 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.28 2019/02/11 14:59:32 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.29 2019/05/01 14:29:15 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -205,12 +205,6 @@
        ret
 END(cpu_counter32)
 
-ENTRY(rdpmc)
-       movl    4(%esp), %ecx
-       rdpmc
-       ret
-END(rdpmc)
-
 ENTRY(rdtsc)
        rdtsc
        ret
@@ -328,12 +322,6 @@
        ret
 END(x86_getss)
 
-ENTRY(fldcw)
-       movl    4(%esp), %eax
-       fldcw   (%eax)
-       ret
-END(fldcw)
-
 ENTRY(fnclex)  
        fnclex
        ret
@@ -367,25 +355,12 @@
        ret
 END(fnstsw)
 
-ENTRY(fp_divide_by_0)
-       fldz
-       fld1
-       fdiv    %st, %st(1)
-       fwait
-       ret
-END(fp_divide_by_0)
-
 ENTRY(frstor)
        movl    4(%esp), %eax
        frstor  (%eax)
        ret
 END(frstor)
 
-ENTRY(fwait)
-       fwait
-       ret
-END(fwait)
-
 ENTRY(clts)
        clts
        ret
diff -r 99a87614e98a -r ed8278c0c846 sys/arch/x86/include/cpufunc.h
--- a/sys/arch/x86/include/cpufunc.h    Wed May 01 14:10:26 2019 +0000
+++ b/sys/arch/x86/include/cpufunc.h    Wed May 01 14:29:15 2019 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: cpufunc.h,v 1.24 2018/02/22 09:41:06 maxv Exp $        */
+/*     $NetBSD: cpufunc.h,v 1.25 2019/05/01 14:29:15 maxv Exp $        */
 
-/*-
- * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
+/*
+ * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -49,16 +49,33 @@
 void   x86_sfence(void);
 void   x86_mfence(void);
 void   x86_flush(void);
+void   x86_hlt(void);
+void   x86_stihlt(void);
+void   tlbflush(void);
+void   tlbflushg(void);
+void   invlpg(vaddr_t);
+void   wbinvd(void);
+void   breakpoint(void);
+uint64_t rdtsc(void);
 #ifndef XEN
 void   x86_hotpatch(uint32_t, const uint8_t *, size_t);
 void   x86_patch_window_open(u_long *, u_long *);
 void   x86_patch_window_close(u_long, u_long);
 void   x86_patch(bool);
 #endif
-void   invlpg(vaddr_t);
+
+void   x86_monitor(const void *, uint32_t, uint32_t);
+void   x86_mwait(uint32_t, uint32_t);
+/* x86_cpuid2() writes four 32bit values, %eax, %ebx, %ecx and %edx */
+#define        x86_cpuid(a,b)  x86_cpuid2((a),0,(b))
+void   x86_cpuid2(uint32_t, uint32_t, uint32_t *);
+
+/* -------------------------------------------------------------------------- */
+
 void   lidt(struct region_descriptor *);
 void   lldt(u_short);
 void   ltr(u_short);
+
 void   lcr0(u_long);
 u_long rcr0(void);
 void   lcr2(vaddr_t);
@@ -69,8 +86,7 @@
 vaddr_t        rcr4(void);
 void   lcr8(vaddr_t);
 vaddr_t        rcr8(void);
-void   tlbflush(void);
-void   tlbflushg(void);
+
 register_t     rdr0(void);
 void           ldr0(register_t);
 register_t     rdr1(void);
@@ -83,15 +99,16 @@
 void           ldr6(register_t);
 register_t     rdr7(void);
 void           ldr7(register_t);
-void   wbinvd(void);
-void   breakpoint(void);
-void   x86_hlt(void);
-void   x86_stihlt(void);
+
 u_int  x86_getss(void);
+void   setds(int);
+void   setes(int);
+void   setfs(int);
+void   setusergs(int);
 
-/* fpu save, restore etc */
+/* -------------------------------------------------------------------------- */
+
 union savefpu;
-void   fldcw(const uint16_t *);
 void   fnclex(void);
 void   fninit(void);
 void   fnsave(union savefpu *);
@@ -99,31 +116,23 @@
 uint16_t fngetsw(void);
 void   fnstsw(uint16_t *);
 void   frstor(const union savefpu *);
-void   fwait(void);
 void   clts(void);
 void   stts(void);
 void   fxsave(union savefpu *);
 void   fxrstor(const union savefpu *);
+
 void   x86_ldmxcsr(const uint32_t *);
 void   x86_stmxcsr(uint32_t *);
-
 void   fldummy(void);
-void   fp_divide_by_0(void);
 
-/* Extended processor state functions (for AVX registers etc) */
-
-uint64_t rdxcr(uint32_t);              /* xgetbv */
-void   wrxcr(uint32_t, uint64_t);      /* xsetgv */
+uint64_t rdxcr(uint32_t);
+void   wrxcr(uint32_t, uint64_t);
 
 void   xrstor(const union savefpu *, uint64_t);
 void   xsave(union savefpu *, uint64_t);
 void   xsaveopt(union savefpu *, uint64_t);
 
-void   x86_monitor(const void *, uint32_t, uint32_t);
-void   x86_mwait(uint32_t, uint32_t);
-/* x86_cpuid2() writes four 32bit values, %eax, %ebx, %ecx and %edx */
-#define        x86_cpuid(a,b)  x86_cpuid2((a),0,(b))
-void   x86_cpuid2(uint32_t, uint32_t, uint32_t *);
+/* -------------------------------------------------------------------------- */
 
 /* Use read_psl, write_psl when saving and restoring interrupt state. */
 void   x86_disable_intr(void);
@@ -137,6 +146,8 @@
 
 void   x86_reset(void);
 
+/* -------------------------------------------------------------------------- */
+
 /* 
  * Some of the undocumented AMD64 MSRs need a 'passcode' to access.
  *
@@ -148,14 +159,8 @@
 uint64_t       rdmsr(u_int);
 uint64_t       rdmsr_locked(u_int);
 int            rdmsr_safe(u_int, uint64_t *);
-uint64_t       rdtsc(void);
-uint64_t       rdpmc(u_int);
 void           wrmsr(u_int, uint64_t);
 void           wrmsr_locked(u_int, uint64_t);
-void           setds(int);
-void           setes(int);
-void           setfs(int);
-void           setusergs(int);
 
 #endif /* _KERNEL */
 



Home | Main Index | Thread Index | Old Index