patch-2.4.13 linux/arch/arm/kernel/setup.c

Next file: linux/arch/arm/kernel/signal.c
Previous file: linux/arch/arm/kernel/init_task.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/arch/arm/kernel/setup.c linux/arch/arm/kernel/setup.c
@@ -260,10 +260,10 @@
 	struct resource *res;
 	int i;
 
-	kernel_code.start  = __virt_to_bus(init_mm.start_code);
-	kernel_code.end    = __virt_to_bus(init_mm.end_code - 1);
-	kernel_data.start  = __virt_to_bus(init_mm.end_code);
-	kernel_data.end    = __virt_to_bus(init_mm.brk - 1);
+	kernel_code.start  = __virt_to_phys(init_mm.start_code);
+	kernel_code.end    = __virt_to_phys(init_mm.end_code - 1);
+	kernel_data.start  = __virt_to_phys(init_mm.end_code);
+	kernel_data.end    = __virt_to_phys(init_mm.brk - 1);
 
 	for (i = 0; i < mi->nr_banks; i++) {
 		unsigned long virt_start, virt_end;
@@ -520,9 +520,44 @@
 #endif
 }
 
-int get_cpuinfo(char * buffer)
+static const char *hwcap_str[] = {
+	"swp",
+	"half",
+	"thumb",
+	"26bit",
+	"fastmult",
+	"fpa",
+	"vfp",
+	"edsp",
+	NULL
+};
+
+/*
+ * get_cpuinfo - Get information on one CPU for use by the procfs.
+ *
+ *	Prints info on the next CPU into buffer.  Beware, doesn't check for
+ *	buffer overflow.  Current implementation of procfs assumes that the
+ *	resulting data is <= 1K.
+ *
+ * Args:
+ *	buffer	-- you guessed it, the data buffer
+ *	cpu_np	-- Input: next cpu to get (start at 0).  Output: Updated.
+ *
+ *	Returns number of bytes written to buffer.
+ */
+
+int get_cpuinfo(char *buffer, unsigned *cpu_np)
 {
 	char *p = buffer;
+	unsigned n;
+	int i;
+
+ 	/* No SMP at the moment, so just toggle 0/1 */
+	n = *cpu_np;
+	*cpu_np = 1;
+	if (n != 0) {
+		return (0);
+	}
 
 	p += sprintf(p, "Processor\t: %s %s rev %d (%s)\n",
 		     proc_info.manufacturer, proc_info.cpu_name,
@@ -531,6 +566,15 @@
 	p += sprintf(p, "BogoMIPS\t: %lu.%02lu\n",
 		     loops_per_jiffy / (500000/HZ),
 		     (loops_per_jiffy / (5000/HZ)) % 100);
+
+	/* dump out the processor features */
+	p += sprintf(p, "Features\t: ");
+
+	for (i = 0; hwcap_str[i]; i++)
+		if (elf_hwcap & (1 << i))
+			p += sprintf(p, "%s ", hwcap_str[i]);
+
+	p += sprintf(p, "\n\n");
 
 	p += sprintf(p, "Hardware\t: %s\n", machine_name);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)