lkml.org 
[lkml]   [1999]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectfix: axp-patch-2.2.2-???
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.

Thanks again to Daniel J. Frasnelli for isolating
the offending code segments...

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.

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; \
\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.025 / U:1.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site