|
From: James S. <jsi...@us...> - 2002-11-23 00:56:17
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/alpha/kernel
In directory sc8-pr-cvs1:/tmp/cvs-serv1514/linux/arch/alpha/kernel
Modified Files:
setup.c
Log Message:
Synced to 2.5.49 console BK tree.
Index: setup.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/arch/alpha/kernel/setup.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- setup.c 1 Nov 2002 23:12:36 -0000 1.11
+++ setup.c 23 Nov 2002 00:55:44 -0000 1.12
@@ -98,9 +98,11 @@
#define N(a) (sizeof(a)/sizeof(a[0]))
-static struct alpha_machine_vector *get_sysvec(long, long, long);
+static struct alpha_machine_vector *get_sysvec(unsigned long, unsigned long,
+ unsigned long);
static struct alpha_machine_vector *get_sysvec_byname(const char *);
-static void get_sysnames(long, long, long, char **, char **);
+static void get_sysnames(unsigned long, unsigned long, unsigned long,
+ char **, char **);
static char command_line[COMMAND_LINE_SIZE];
char saved_command_line[COMMAND_LINE_SIZE];
@@ -202,7 +204,7 @@
};
struct resource *io = &ioport_resource;
- long i;
+ size_t i;
if (hose_head) {
struct pci_controller *hose;
@@ -249,6 +251,27 @@
return end >> PAGE_SHIFT; /* Return the PFN of the limit. */
}
+#ifdef CONFIG_BLK_DEV_INITRD
+void * __init
+move_initrd(unsigned long mem_limit)
+{
+ void *start;
+ unsigned long size;
+
+ size = initrd_end - initrd_start;
+ start = __alloc_bootmem(size, PAGE_SIZE, 0);
+ if (!start || __pa(start) + size > mem_limit) {
+ initrd_start = initrd_end = 0;
+ return NULL;
+ }
+ memmove(start, (void *)initrd_start, size);
+ initrd_start = (unsigned long)start;
+ initrd_end = initrd_start + size;
+ printk("initrd moved to %p\n", start);
+ return start;
+}
+#endif
+
#ifndef CONFIG_DISCONTIGMEM
static void __init
setup_memory(void *kernel_end)
@@ -258,7 +281,7 @@
unsigned long start_kernel_pfn, end_kernel_pfn;
unsigned long bootmap_size, bootmap_pages, bootmap_start;
unsigned long start, end;
- int i;
+ unsigned long i;
/* Find free clusters, and init and free the bootmem accordingly. */
memdesc = (struct memdesc_struct *)
@@ -327,7 +350,7 @@
}
}
- if (bootmap_start == -1) {
+ if (bootmap_start == ~0UL) {
max_low_pfn >>= 1;
goto try_again;
}
@@ -377,11 +400,11 @@
(void *) initrd_start, INITRD_SIZE);
if ((void *)initrd_end > phys_to_virt(PFN_PHYS(max_low_pfn))) {
- printk("initrd extends beyond end of memory "
- "(0x%08lx > 0x%p)\ndisabling initrd\n",
- initrd_end,
- phys_to_virt(PFN_PHYS(max_low_pfn)));
- initrd_start = initrd_end = 0;
+ if (!move_initrd(PFN_PHYS(max_low_pfn)))
+ printk("initrd extends beyond end of memory "
+ "(0x%08lx > 0x%p)\ndisabling initrd\n",
+ initrd_end,
+ phys_to_virt(PFN_PHYS(max_low_pfn)));
} else {
reserve_bootmem(virt_to_phys((void *)initrd_start),
INITRD_SIZE);
@@ -398,7 +421,7 @@
{
struct memclust_struct * cluster;
struct memdesc_struct * memdesc;
- int i;
+ unsigned long i;
memdesc = (struct memdesc_struct *)
(hwrpb->mddt_offset + (unsigned long) hwrpb);
@@ -678,7 +701,7 @@
static int tsunami_indices[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
static struct alpha_machine_vector * __init
-get_sysvec(long type, long variation, long cpu)
+get_sysvec(unsigned long type, unsigned long variation, unsigned long cpu)
{
static struct alpha_machine_vector *systype_vecs[] __initdata =
{
@@ -785,10 +808,6 @@
struct alpha_machine_vector *vec;
- /* Restore real CABRIO and EB66+ family names, ie EB64+ and EB66 */
- if (type < 0)
- type = -type;
-
/* Search the system tables first... */
vec = NULL;
if (type < N(systype_vecs)) {
@@ -805,7 +824,7 @@
if (!vec) {
/* Member ID is a bit-field. */
- long member = (variation >> 10) & 0x3f;
+ unsigned long member = (variation >> 10) & 0x3f;
cpu &= 0xffffffff; /* make it usable */
@@ -904,8 +923,9 @@
&xlt_mv
};
- int i, n = sizeof(all_vecs)/sizeof(*all_vecs);
- for (i = 0; i < n; ++i) {
+ size_t i;
+
+ for (i = 0; i < N(all_vecs); ++i) {
struct alpha_machine_vector *mv = all_vecs[i];
if (strcasecmp(mv->vector_name, name) == 0)
return mv;
@@ -914,14 +934,10 @@
}
static void
-get_sysnames(long type, long variation, long cpu,
+get_sysnames(unsigned long type, unsigned long variation, unsigned long cpu,
char **type_name, char **variation_name)
{
- long member;
-
- /* Restore real CABRIO and EB66+ family names, ie EB64+ and EB66 */
- if (type < 0)
- type = -type;
+ unsigned long member;
/* If not in the tables, make it UNKNOWN,
else set type name to family */
@@ -939,7 +955,7 @@
return;
}
- /* Set variation to "0"; if variation is zero, done */
+ /* Set variation to "0"; if variation is zero, done. */
*variation_name = systype_names[0];
if (variation == 0) {
return;
@@ -1029,7 +1045,8 @@
get_nr_processors(struct percpu_struct *cpubase, unsigned long num)
{
struct percpu_struct *cpu;
- int i, count = 0;
+ unsigned long i;
+ int count = 0;
for (i = 0; i < num; i++) {
cpu = (struct percpu_struct *)
|