linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Leete <tleete@mountain.net>
To: Matt Wright <matt@teletubbies.dhs.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Re: 2.4.0-testX fails to compile on my Athlon
Date: Tue, 02 Jan 2001 03:51:24 -0500	[thread overview]
Message-ID: <3A51968C.618D272B@mountain.net> (raw)
In-Reply-To: <Pine.LNX.4.21.0012311635530.1649-100000@po.teletubbies.dhs.org>

[-- Attachment #1: Type: text/plain, Size: 1340 bytes --]

Matt Wright wrote:
> 
> I've looked for answers to this question before, but all I could find was
> someone asking a similar question and no replies...
> 
> I'm having great trouble getting 2.4.0-testX to compile on my system when
> I select Athlon/K7 as the Processor Family....
> 
> I've attached below the error's I'm getting.... the kernel DOES compile if
> I select anything else... but I don't have anything else :)
> 

Hello,

The problem with SMP+K7 builds is that include/asm-i386/string.h has no
business using in_interrupt(). That introduces circular dependencies which
nobody has been able to rearrange away.

Here is a patch I've posted here several times. It moves the mmx functions
from string.h to arch/i386/lib/mmx.c (lib.a).It does not __inline__ the call
for memcpy() of large or unknown length. Athlon supposedly does branch
prediction for function pointers, so that shouldn't hurt too much. The point
is to get it to build: optimize later.

The actual usefulness of this may be limited to development on UP machines.
I don't know whether the AMD-760 SMP boards will be compatable with Linux
SMP. Hearsay is that they will have significant architectural differences
with Intel flavored SMP boards.

Cheers,
Tom

Patch as attachment to avoid mailer brain damage. It has not been tested
lately, but still applies cleanish.

[-- Attachment #2: k7-smp.patch --]
[-- Type: text/plain, Size: 2151 bytes --]

--- linux/arch/i386/lib/mmx.c.orig	Wed Oct 27 21:30:39 1999
+++ linux/arch/i386/lib/mmx.c	Tue Jun  6 04:20:01 2000
@@ -1,6 +1,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/sched.h>
+#include <asm/hardirq.h>
 
 /*
  *	MMX 3DNow! library helper functions
@@ -88,6 +89,21 @@
 	stts();
 	return p;
 }
+
+void * __constant_mmx_memcpy3d(void * to, const void * from, size_t len)
+{
+	if(in_interrupt())
+		return __constant_memcpy(to, from, len);
+	return _mmx_memcpy(to, from, len);
+}
+
+void *__mmx_memcpy3d(void *to, const void *from, size_t len)
+{
+	if(in_interrupt())
+		return __memcpy(to, from, len);
+	return _mmx_memcpy(to, from, len);
+}
+
 
 static void fast_clear_page(void *page)
 {
--- linux/include/asm-i386/mmx.h.orig	Tue Jun  6 03:05:02 2000
+++ linux/include/asm-i386/mmx.h	Tue Jun  6 04:25:27 2000
@@ -10,5 +10,7 @@
 extern void *_mmx_memcpy(void *to, const void *from, size_t size);
 extern void mmx_clear_page(void *page);
 extern void mmx_copy_page(void *to, void *from);
+extern __inline__ void *__constant_mmx_memcpy3d(void * to, const void * from, size_t len);
+extern __inline__ void *__mmx_memcpy3d(void *to, const void *from, size_t len);
 
 #endif
--- linux/include/asm-i386/string.h.orig	Tue Jun  6 03:05:02 2000
+++ linux/include/asm-i386/string.h	Tue Jun  6 04:30:37 2000
@@ -287,13 +287,6 @@
 
 #ifdef CONFIG_X86_USE_3DNOW
 
-/* All this just for in_interrupt() ... */
-
-#include <asm/system.h>
-#include <asm/ptrace.h>
-#include <linux/smp.h>
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
 #include <asm/mmx.h>
 
 /*
@@ -302,16 +295,16 @@
 
 static inline void * __constant_memcpy3d(void * to, const void * from, size_t len)
 {
-	if(len<512 || in_interrupt())
+	if(len<512)
 		return __constant_memcpy(to, from, len);
-	return _mmx_memcpy(to, from, len);
+	return __constant_mmx_memcpy3d(to, from, len);
 }
 
 extern __inline__ void *__memcpy3d(void *to, const void *from, size_t len)
 {
-	if(len<512 || in_interrupt())
+	if(len<512)
 		return __memcpy(to, from, len);
-	return _mmx_memcpy(to, from, len);
+	return __mmx_memcpy3d(to, from, len);
 }
 
 #define memcpy(t, f, n) \

  parent reply	other threads:[~2001-01-02  9:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-01  0:42 2.4.0-testX fails to compile on my Athlon Matt Wright
2001-01-01 20:01 ` wish-kernel
2001-01-01 22:44   ` Matt Wright
2001-01-02  8:51 ` Tom Leete [this message]
2001-01-02 18:44 [PATCH] " Petr Vandrovec
2001-01-02 18:02 ` Alan Cox
     [not found] ` <3A52D390.AB56FFF2@mountain.net>
2001-01-03 11:20   ` Petr Vandrovec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A51968C.618D272B@mountain.net \
    --to=tleete@mountain.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@teletubbies.dhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).