mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* x86-64 fixes for 2.4.21-pre5
@ 2003-03-05 18:00 Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2003-03-05 18:00 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

This fixes a linkage error caused by the IDE layer's use of the
new ndelay() macro. I simply cloned the i386 implementation.

This also silences two assembler warnings in bootsect.S and setup.S.
Those warnings are caused by a change in binutils' behaviour a LONG
time ago. This can't be fixed for i386 in the official stable kernel
since it breaks old tool chains, but that's not an issue for x86-64.

Boots and runs Ok on Simics.

/Mikael

--- linux-2.4.21-pre5/arch/x86_64/boot/bootsect.S.~1~	2003-03-05 17:37:42.000000000 +0100
+++ linux-2.4.21-pre5/arch/x86_64/boot/bootsect.S	2003-03-05 18:33:12.000000000 +0100
@@ -236,7 +236,7 @@
 rp_read:
 #ifdef __BIG_KERNEL__			# look in setup.S for bootsect_kludge
 	bootsect_kludge = 0x220		# 0x200 + 0x20 which is the size of the
-	lcall	bootsect_kludge		# bootsector + bootsect_kludge offset
+	lcall	*bootsect_kludge	# bootsector + bootsect_kludge offset
 #else
 	movw	%es, %ax
 	subw	$SYSSEG, %ax
--- linux-2.4.21-pre5/arch/x86_64/boot/setup.S.~1~	2002-11-30 17:12:24.000000000 +0100
+++ linux-2.4.21-pre5/arch/x86_64/boot/setup.S	2003-03-05 18:33:32.000000000 +0100
@@ -449,7 +449,7 @@
 	cmpw	$0, %cs:realmode_swtch
 	jz	rmodeswtch_normal
 
-	lcall	%cs:realmode_swtch
+	lcall	*%cs:realmode_swtch
 
 	jmp	rmodeswtch_end
 
--- linux-2.4.21-pre5/arch/x86_64/lib/delay.c.~1~	2002-11-30 17:12:24.000000000 +0100
+++ linux-2.4.21-pre5/arch/x86_64/lib/delay.c	2003-03-05 18:24:25.000000000 +0100
@@ -41,3 +41,8 @@
 {
 	__const_udelay(usecs * 0x000010c6);  /* 2**32 / 1000000 */
 }
+
+void __ndelay(unsigned long usecs)
+{
+	__const_udelay(usecs * 0x00005);  /* 2**32 / 1000000000 (rounded up) */
+}
--- linux-2.4.21-pre5/include/asm-x86_64/delay.h.~1~	2002-11-30 17:12:31.000000000 +0100
+++ linux-2.4.21-pre5/include/asm-x86_64/delay.h	2003-03-05 18:22:04.000000000 +0100
@@ -8,13 +8,19 @@
  */
  
 extern void __bad_udelay(void);
+extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
+extern void __ndelay(unsigned long usecs);
 extern void __const_udelay(unsigned long usecs);
 extern void __delay(unsigned long loops);
 
 #define udelay(n) (__builtin_constant_p(n) ? \
 	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
 	__udelay(n))
+	
+#define ndelay(n) (__builtin_constant_p(n) ? \
+	((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \
+	__ndelay(n))
 
 #endif /* defined(_X8664_DELAY_H) */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-03-06 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <15974.15180.311304.526712@gargle.gargle.HOWL.suse.lists.linux.kernel>
2003-03-06 11:40 ` x86-64 fixes for 2.4.21-pre5 Andi Kleen
2003-03-06 12:57   ` Mikael Pettersson
2003-03-05 18:00 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®