mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: "David S. Miller" <davem@redhat.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Cc: Paul Jackson <pj@sgi.com>
Subject: [patch] sparc 32 cpumask bitop build fix
Date: Sat, 3 Jul 2004 20:14:24 -0700 (PDT)	[thread overview]
Message-ID: <20040704031424.9074.25825.72298@sam.engr.sgi.com> (raw)

With the following changes, I was able to compile the "sparc" (32
bit) arch, using defconfig and crosstool.  There were still plenty
of warnings, but nothing else relating to bitops or cpumasks that
I noticed.  This is working with 2.6.7-mm5.

I have no way to boot test this, but these changes seem obvious
enough that I'd recommend including them.

Signed-off-by: Paul Jackson <pj@sgi.com>

Index: 267mm5cpusetv4sparc/include/asm-sparc/bitops.h
===================================================================
--- 267mm5cpusetv4sparc.orig/include/asm-sparc/bitops.h	2004-07-03 01:00:34.000000000 -0700
+++ 267mm5cpusetv4sparc/include/asm-sparc/bitops.h	2004-07-03 04:45:36.000000000 -0700
@@ -366,9 +366,9 @@ found_middle:
  *
  * Scheduler induced bitop, do not use.
  */
-static inline int find_next_bit(unsigned long *addr, int size, int offset)
+static inline int find_next_bit(const unsigned long *addr, int size, int offset)
 {
-	unsigned long *p = addr + (offset >> 5);
+	const unsigned long *p = addr + (offset >> 5);
 	int num = offset & ~0x1f;
 	unsigned long word;
 
@@ -384,6 +384,17 @@ static inline int find_next_bit(unsigned
 	return num;
 }
 
+/**
+ * find_first_bit - find the first set bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The maximum size to search
+ *
+ * Returns the bit-number of the first set bit, not the number of the byte
+ * containing a bit.
+ */
+#define find_first_bit(addr, size) \
+	find_next_bit((addr), (size), 0)
+
 /*
  */
 static inline int test_le_bit(int nr, __const__ unsigned long * addr)
Index: 267mm5cpusetv4sparc/include/asm-sparc/system.h
===================================================================
--- 267mm5cpusetv4sparc.orig/include/asm-sparc/system.h	2004-07-03 01:00:35.000000000 -0700
+++ 267mm5cpusetv4sparc/include/asm-sparc/system.h	2004-07-03 05:06:03.000000000 -0700
@@ -126,7 +126,7 @@ extern void fpsave(unsigned long *fpregs
 #define switch_to(prev, next, last) do {						\
 	SWITCH_ENTER(prev);								\
 	SWITCH_DO_LAZY_FPU(next);							\
-	next->active_mm->cpu_vm_mask |= (1 << smp_processor_id());			\
+	cpu_set(smp_processor_id(), next->active_mm->cpu_vm_mask);			\
 	__asm__ __volatile__(								\
 	"sethi	%%hi(here - 0x8), %%o7\n\t"						\
 	"mov	%%g6, %%g3\n\t"								\

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

                 reply	other threads:[~2004-07-04  3:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040704031424.9074.25825.72298@sam.engr.sgi.com \
    --to=pj@sgi.com \
    --cc=akpm@osdl.org \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®