Re: Compile error 2.4.15-pre4 on alpha

Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Tue, 13 Nov 2001 16:59:11 +0300


On Mon, Nov 12, 2001 at 11:17:25PM -0500, Jeff Garzik wrote:
> > fs/fs.o(.text+0x2cf88): undefined reference to `cpuinfo_op'
> > make: *** [vmlinux] Error 1
>
> looks like alpha needs to implement /proc/cpuinfo as seqfile, as Linus
> said.

Patch appended.

Ivan.

--- 2.4.15p4/arch/alpha/kernel/setup.c Sat Nov 3 04:39:20 2001
+++ linux/arch/alpha/kernel/setup.c Tue Nov 13 15:00:54 2001
@@ -30,6 +30,7 @@
#include <linux/ioport.h>
#include <linux/bootmem.h>
#include <linux/pci.h>
+#include <linux/seq_file.h>

#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/blk.h>
@@ -1043,10 +1044,8 @@ get_nr_processors(struct percpu_struct *
}


-/*
- * BUFFER is PAGE_SIZE bytes long.
- */
-int get_cpuinfo(char *buffer)
+static int
+show_cpuinfo(struct seq_file *f, void *slot)
{
extern struct unaligned_stat {
unsigned long count, va, pc;
@@ -1058,14 +1057,15 @@ int get_cpuinfo(char *buffer)
"EV68CX", "EV7", "EV79", "EV69"
};

- struct percpu_struct *cpu;
+ struct percpu_struct *cpu = slot;
unsigned int cpu_index;
char *cpu_name;
char *systype_name;
char *sysvariation_name;
- int len, nr_processors;
+ int nr_processors;

- cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);
+ if (!cpu)
+ return 1;
cpu_index = (unsigned) (cpu->type - 1);
cpu_name = "Unknown";
if (cpu_index < N(cpu_names))
@@ -1076,8 +1076,7 @@ int get_cpuinfo(char *buffer)

nr_processors = get_nr_processors(cpu, hwrpb->nr_processors);

- len = sprintf(buffer,
- "cpu\t\t\t: Alpha\n"
+ seq_printf(f, "cpu\t\t\t: Alpha\n"
"cpu model\t\t: %s\n"
"cpu variation\t\t: %ld\n"
"cpu revision\t\t: %ld\n"
@@ -1114,11 +1113,41 @@ int get_cpuinfo(char *buffer)
platform_string(), nr_processors);

#ifdef CONFIG_SMP
- len += smp_info(buffer+len);
+ seq_printf(f, "cpus active\t\t: %d\n"
+ "cpu active mask\t\t: %016lx\n",
+ smp_num_cpus, cpu_present_mask);
#endif

- return len;
+ return 0;
+}
+
+/*
+ * We show only CPU #0 info.
+ */
+static void *
+c_start(struct seq_file *f, loff_t *pos)
+{
+ return *pos ? NULL : (char *)hwrpb + hwrpb->processor_offset;
+}
+
+static void *
+c_next(struct seq_file *f, void *v, loff_t *pos)
+{
+ return NULL;
}
+
+static void
+c_stop(struct seq_file *f, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+ start: c_start,
+ next: c_next,
+ stop: c_stop,
+ show: show_cpuinfo,
+};
+

static int alpha_panic_event(struct notifier_block *this,
unsigned long event,
--- 2.4.15p4/arch/alpha/kernel/proto.h Fri Mar 2 22:12:07 2001
+++ linux/arch/alpha/kernel/proto.h Tue Nov 13 13:50:59 2001
@@ -91,7 +91,6 @@ extern void unregister_srm_console(void)

/* smp.c */
extern void setup_smp(void);
-extern int smp_info(char *buffer);
extern void handle_ipi(struct pt_regs *);
extern void smp_percpu_timer_interrupt(struct pt_regs *);

--- 2.4.15p4/arch/alpha/kernel/smp.c Mon Oct 8 23:37:11 2001
+++ linux/arch/alpha/kernel/smp.c Tue Nov 13 13:10:48 2001
@@ -1091,15 +1091,6 @@ flush_icache_page(struct vm_area_struct
}
}

-int
-smp_info(char *buffer)
-{
- return sprintf(buffer,
- "cpus active\t\t: %d\n"
- "cpu active mask\t\t: %016lx\n",
- smp_num_cpus, cpu_present_mask);
-}
-
#if DEBUG_SPINLOCK
void
spin_unlock(spinlock_t * lock)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/