Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Robert Bowles <rbowles@op.net>
To: axp-list@redhat.com
Cc: dfrasnel@csee.wvu.edu
Subject: Re: [patches] patch-2.2.2-nonx86,patch-2.2.2-filter
Date: Wed, 24 Feb 1999 00:10:55 -0500	[thread overview]
Message-ID: <19990224001055.D927@op.net> (raw)
In-Reply-To: <19990223211716.B18379@csee.wvu.edu>; from Daniel J. Frasnelli on Tue, Feb 23, 1999 at 09:17:16PM -0500

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

Thanks again for the pointers.
I think I got a "roll-forward" patch partly thrown together...

Changes/Observations
- Socket Filtering Code
	This alone should be a showstopper.
	I don't see where this could work on any platform.
	'struct sk_filter' is referenced but not defined _anywhere_.
	The only solution is to build w/o socket filtering code.
- Semaphore Code
	All seems well, except for the whole new
	'__down_trylock() / waking_non_zero_trylock()' bit.

Attached is a patch that does compile without too much weirdness.
On the plus side, no rollbacks of x86 code. (someone test this)
On the minus, I'm not certain about the semaphore code...
On the minus, socket filtering is broken.

Good Luck,
	Bob
--
I found my brain and it hurts.

On Tue, Feb 23, 1999 at 09:17:16PM -0500, Daniel J. Frasnelli wrote:
> 	So I pointed my browser over to www.alphalinux.org earlier today,
> and found this little item near the top:
>    * February 23rd 1999
>      The good news is that kernel 2.2.2 has been released. The bad news
>    is that it does not compile on Alpha.                                        
> 
> 	Ah, how sad it was indeed.
> Maybe the two attached patches will brighten your day.  The first patch
> (nonx86) should take care of those nasty x86 semaphores like __down_trylock, 
> and the second (filter) should take care of, well, broken filter code. 
> I've had 2.2.2 running for approximately 7+ hours total today, so
> the patch appears to be safe. 
> 	Note that it is not a comprehensive solution.  The final "fix"
> for this problem will be bringing semaphores on axp up to where x86 is
> right now.  We're working on that as well, but in the meantime this
> should allow building of 2.2.2.
> 	I've tested this on my Alpha, but it should work for any non-x86
> platform.  I am currently compiling the 2.2.2ac1 kernel with the
> non-x86 patch applied, so I assume the patch fixes that one as well.
> 
> Enjoy,
> Daniel
> -- 
<- snip ->

[-- Attachment #2: axp-patch-2.2.2-rb0 --]
[-- Type: text/plain, Size: 3902 bytes --]

diff -u --recursive linux-2.2.2-dist/include/asm-alpha/semaphore.h linux-2.2.2/include/asm-alpha/semaphore.h
--- linux-2.2.2-dist/include/asm-alpha/semaphore.h	Fri Jan 22 05:27:21 1999
+++ linux-2.2.2/include/asm-alpha/semaphore.h	Tue Feb 23 23:37:40 1999
@@ -42,6 +42,10 @@
 
 extern void __down(struct semaphore * sem);
 extern int  __down_interruptible(struct semaphore * sem);
+#ifndef __alpha__
+extern int  __down_trylock(struct semaphore * sem);
+#endif
+
 extern void __up(struct semaphore * sem);
 
 /* All three have custom assembly linkages.  */
diff -u --recursive linux-2.2.2-dist/include/linux/filter.h linux-2.2.2/include/linux/filter.h
--- linux-2.2.2-dist/include/linux/filter.h	Sun Dec 21 20:41:24 1997
+++ linux-2.2.2/include/linux/filter.h	Tue Feb 23 23:08:05 1999
@@ -100,7 +100,14 @@
 #define BPF_MEMWORDS 16
 
 #ifdef __KERNEL__
+/* doing this for an axp-fix, but this seems right period
+ * as per net/core/filter.c
+ */
+#if 1
+extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
+#else
 extern int sk_run_filter(unsigned char *data, int len, struct sock_filter *filter, int flen);
+#endif
 extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
 #endif /* __KERNEL__ */
 
diff -u --recursive linux-2.2.2-dist/include/net/sock.h linux-2.2.2/include/net/sock.h
--- linux-2.2.2-dist/include/net/sock.h	Mon Feb 22 23:22:47 1999
+++ linux-2.2.2/include/net/sock.h	Tue Feb 23 23:38:56 1999
@@ -793,7 +793,7 @@
 {
 	int pkt_len;
 
-        pkt_len = sk_run_filter(skb, filter->insns, filter->len);
+        pkt_len = sk_run_filter(skb, &(filter->insns), filter->len);
         if(!pkt_len)
                 return 1;	/* Toss Packet */
         else
@@ -801,6 +801,10 @@
 
 	return 0;
 }
+
+#ifdef __alpha__
+#define sk_filter_len(filt) filt->len
+#endif
 
 extern __inline__ void sk_filter_release(struct sock *sk, struct sk_filter *fp)
 {
diff -u --recursive linux-2.2.2-dist/kernel/ksyms.c linux-2.2.2/kernel/ksyms.c
--- linux-2.2.2-dist/kernel/ksyms.c	Tue Feb 23 22:27:42 1999
+++ linux-2.2.2/kernel/ksyms.c	Tue Feb 23 23:37:09 1999
@@ -61,7 +61,7 @@
 extern void free_dma(unsigned int dmanr);
 extern spinlock_t dma_spin_lock;
 
-#ifdef CONFIG_MODVERSIONS
+#ifdef MODVERSIONS
 const struct module_symbol __export_Using_Versions
 __attribute__((section("__ksymtab"))) = {
 	1 /* Version version */, "Using_Versions"
@@ -322,8 +322,10 @@
 EXPORT_SYMBOL(sprintf);
 EXPORT_SYMBOL(vsprintf);
 EXPORT_SYMBOL(kdevname);
+#ifndef __alpha__
 EXPORT_SYMBOL(bdevname);
 EXPORT_SYMBOL(cdevname);
+#endif
 EXPORT_SYMBOL(simple_strtoul);
 EXPORT_SYMBOL(system_utsname);	/* UTS data */
 EXPORT_SYMBOL(uts_sem);		/* UTS semaphore */
@@ -372,7 +370,9 @@
 EXPORT_SYMBOL(event);
 EXPORT_SYMBOL(__down);
 EXPORT_SYMBOL(__down_interruptible);
+#ifndef __alpha__
 EXPORT_SYMBOL(__down_trylock);
+#endif
 EXPORT_SYMBOL(__up);
 EXPORT_SYMBOL(brw_page);
 
diff -u --recursive linux-2.2.2-dist/kernel/sched.c linux-2.2.2/kernel/sched.c
--- linux-2.2.2-dist/kernel/sched.c	Tue Feb 23 07:12:51 1999
+++ linux-2.2.2/kernel/sched.c	Tue Feb 23 23:36:47 1999
@@ -36,7 +36,9 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
+#ifndef __alpha__
 #include <asm/semaphore-helper.h>
+#endif
 
 #include <linux/timex.h>
 
@@ -906,7 +908,11 @@
 {
 	DOWN_VAR
 	DOWN_HEAD(TASK_UNINTERRUPTIBLE)
+#ifdef __alpha__
+	if (waking_non_zero(sem,tsk))
+#else
 	if (waking_non_zero(sem))
+#endif
 		break;
 	schedule();
 	DOWN_TAIL(TASK_UNINTERRUPTIBLE)
@@ -918,7 +924,9 @@
 	int ret = 0;
 	DOWN_HEAD(TASK_INTERRUPTIBLE)
 
+#ifndef __alpha__
 	ret = waking_non_zero_interruptible(sem, tsk);
+#endif
 	if (ret)
 	{
 		if (ret == 1)
@@ -931,10 +939,12 @@
 	return ret;
 }
 
+#ifndef __alpha__
 int __down_trylock(struct semaphore * sem)
 {
 	return waking_non_zero_trylock(sem);
 }
+#endif
 
 #define	SLEEP_ON_VAR				\
 	unsigned long flags;			\

  parent reply	other threads:[~1999-02-24  4:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-24  2:17 [patches] patch-2.2.2-nonx86,patch-2.2.2-filter Daniel J. Frasnelli
1999-02-24  3:12 ` 2.2.2ac1 needs to come with a warning label :-) Daniel J. Frasnelli
1999-02-24  3:26   ` Peter Petrakis
1999-02-24  3:50     ` Daniel J. Frasnelli
1999-02-24  5:10 ` Robert Bowles [this message]
1999-02-24  5:51   ` [patches] :) Robert Bowles
1999-02-24  6:09     ` 2.2.2ac2 (Re: [patches] :)) Daniel J. Frasnelli
1999-02-24  6:37       ` Michal Jaegermann
1999-02-24  6:47         ` Daniel J. Frasnelli
1999-02-24  6:26   ` [patches] patch-2.2.2-nonx86,patch-2.2.2-filter Michal Jaegermann
read-only archive

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