From owner-p4-projects@FreeBSD.ORG Fri Apr 25 18:15:56 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AFBDC37B404; Fri, 25 Apr 2003 18:15:55 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A36D37B401 for ; Fri, 25 Apr 2003 18:15:55 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5B0043F3F for ; Fri, 25 Apr 2003 18:15:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3Q1Fs0U006229 for ; Fri, 25 Apr 2003 18:15:54 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3Q1Fs28006224 for perforce@freebsd.org; Fri, 25 Apr 2003 18:15:54 -0700 (PDT) Date: Fri, 25 Apr 2003 18:15:54 -0700 (PDT) Message-Id: <200304260115.h3Q1Fs28006224@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 29754 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2003 01:15:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=29754 Change 29754 by peter@peter_daintree on 2003/04/25 18:15:52 remove stub pcpu stuff, use %gs instead of %fs since we have hardware support for %gs via syscall/sysret Affected files ... .. //depot/projects/hammer/sys/x86_64/include/asmacros.h#5 edit .. //depot/projects/hammer/sys/x86_64/include/pcpu.h#10 edit Differences ... ==== //depot/projects/hammer/sys/x86_64/include/asmacros.h#5 (text+ko) ==== @@ -64,13 +64,9 @@ #define NON_GPROF_RET .byte 0xc3 /* opcode for `ret' */ #ifdef LOCORE -#if 0 -#define PCPU(member) %fs:PC_ ## member -#define PCPU_ADDR(member, reg) movq %fs:PC_PRVSPACE,reg; \ +#define PCPU(member) %gs:PC_ ## member +#define PCPU_ADDR(member, reg) movq %gs:PC_PRVSPACE,reg; \ addq $PC_ ## member,reg -#else -#define PCPU(member) __pcpu + PC_ ## member -#endif #endif #ifdef GPROF ==== //depot/projects/hammer/sys/x86_64/include/pcpu.h#10 (text+ko) ==== @@ -52,7 +52,6 @@ #elif defined(__GNUC__) -#if 0 /* * Evaluates to the byte offset of the per-cpu variable name. */ @@ -71,7 +70,7 @@ #define __PCPU_PTR(name) ({ \ __pcpu_type(name) *__p; \ \ - __asm __volatile("movq %%fs:%1,%0; addq %2,%0" \ + __asm __volatile("movq %%gs:%1,%0; addq %2,%0" \ : "=r" (__p) \ : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace))), \ "i" (__pcpu_offset(name))); \ @@ -87,25 +86,25 @@ \ if (sizeof(__result) == 1) { \ u_char __b; \ - __asm __volatile("movb %%fs:%1,%0" \ + __asm __volatile("movb %%gs:%1,%0" \ : "=r" (__b) \ : "m" (*(u_char *)(__pcpu_offset(name)))); \ __result = *(__pcpu_type(name) *)&__b; \ } else if (sizeof(__result) == 2) { \ u_short __w; \ - __asm __volatile("movw %%fs:%1,%0" \ + __asm __volatile("movw %%gs:%1,%0" \ : "=r" (__w) \ : "m" (*(u_short *)(__pcpu_offset(name)))); \ __result = *(__pcpu_type(name) *)&__w; \ } else if (sizeof(__result) == 4) { \ u_int __i; \ - __asm __volatile("movl %%fs:%1,%0" \ + __asm __volatile("movl %%gs:%1,%0" \ : "=r" (__i) \ : "m" (*(u_int *)(__pcpu_offset(name)))); \ __result = *(__pcpu_type(name) *)&__i; \ } else if (sizeof(__result) == 8) { \ u_long __l; \ - __asm __volatile("movq %%fs:%1,%0" \ + __asm __volatile("movq %%gs:%1,%0" \ : "=r" (__l) \ : "m" (*(u_long *)(__pcpu_offset(name)))); \ __result = *(__pcpu_type(name) *)&__l; \ @@ -125,25 +124,25 @@ if (sizeof(__val) == 1) { \ u_char __b; \ __b = *(u_char *)&__val; \ - __asm __volatile("movb %1,%%fs:%0" \ + __asm __volatile("movb %1,%%gs:%0" \ : "=m" (*(u_char *)(__pcpu_offset(name))) \ : "r" (__b)); \ } else if (sizeof(__val) == 2) { \ u_short __w; \ __w = *(u_short *)&__val; \ - __asm __volatile("movw %1,%%fs:%0" \ + __asm __volatile("movw %1,%%gs:%0" \ : "=m" (*(u_short *)(__pcpu_offset(name))) \ : "r" (__w)); \ } else if (sizeof(__val) == 4) { \ u_int __i; \ __i = *(u_int *)&__val; \ - __asm __volatile("movl %1,%%fs:%0" \ + __asm __volatile("movl %1,%%gs:%0" \ : "=m" (*(u_int *)(__pcpu_offset(name))) \ : "r" (__i)); \ } else if (sizeof(__val) == 8) { \ u_long __l; \ __l = *(u_long *)&__val; \ - __asm __volatile("movq %1,%%fs:%0" \ + __asm __volatile("movq %1,%%gs:%0" \ : "=m" (*(u_long *)(__pcpu_offset(name))) \ : "r" (__l)); \ } else { \ @@ -154,15 +153,6 @@ #define PCPU_GET(member) __PCPU_GET(pc_ ## member) #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) -#else - -extern struct pcpu __pcpu; - -#define PCPU_GET(member) (__pcpu.pc_ ## member) -#define PCPU_PTR(member) (&__pcpu.pc_ ## member) -#define PCPU_SET(member,value) (__pcpu.pc_ ## member = (value)) - -#endif #else #error gcc or lint is required to use this file