patch-2.4.0-test3 linux/arch/mips64/sgi-ip27/ip27-memory.c
Next file: linux/arch/mips64/sgi-ip27/ip27-nmi.c
Previous file: linux/arch/mips64/sgi-ip27/ip27-klnuma.c
Back to the patch index
Back to the overall index
- Lines: 96
- Date:
Sun Jul 9 22:18:16 2000
- Orig file:
v2.4.0-test2/linux/arch/mips64/sgi-ip27/ip27-memory.c
- Orig date:
Tue May 23 15:31:33 2000
diff -u --recursive --new-file v2.4.0-test2/linux/arch/mips64/sgi-ip27/ip27-memory.c linux/arch/mips64/sgi-ip27/ip27-memory.c
@@ -1,5 +1,4 @@
-/* $Id: ip27-memory.c,v 1.2 2000/01/27 01:05:24 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
@@ -27,10 +26,8 @@
#include <asm/sn/arch.h>
#include <asm/mmzone.h>
-typedef unsigned long pfn_t; /* into <asm/sn/types.h> */
-#define KDM_TO_PHYS(x) ((x) & TO_PHYS_MASK) /* into asm/addrspace.h */
-
-extern char _end;
+/* ip27-klnuma.c */
+extern pfn_t node_getfirstfree(cnodeid_t cnode);
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
#define SLOT_IGNORED 0xffff
@@ -38,7 +35,6 @@
short slot_lastfilled_cache[MAX_COMPACT_NODES];
unsigned short slot_psize_cache[MAX_COMPACT_NODES][MAX_MEM_SLOTS];
static pfn_t numpages;
-static pfn_t pagenr = 0;
plat_pg_data_t *plat_node_data[MAX_COMPACT_NODES];
bootmem_data_t plat_node_bdata[MAX_COMPACT_NODES];
@@ -46,26 +42,11 @@
int numa_debug(void)
{
printk("NUMA debug\n");
- BUG();
+ *(int *)0 = 0;
return(0);
}
/*
- * Return pfn of first free page of memory on a node. PROM may allocate
- * data structures on the first couple of pages of the first slot of each
- * node. If this is the case, getfirstfree(node) > getslotstart(node, 0).
- */
-pfn_t node_getfirstfree(cnodeid_t cnode)
-{
- nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
-
- if (cnode == 0)
- return (KDM_TO_PHYS(PAGE_ALIGN((unsigned long)(&_end)) -
- (CKSEG0 - K0BASE)) >> PAGE_SHIFT);
- return (KDM_TO_PHYS(PAGE_ALIGN(SYMMON_STK_ADDR(nasid, 0))) >> PAGE_SHIFT);
-}
-
-/*
* Return the number of pages of memory provided by the given slot
* on the specified node.
*/
@@ -261,6 +242,8 @@
#ifdef CONFIG_DISCONTIGMEM
+static pfn_t pagenr = 0;
+
void __init paging_init(void)
{
cnodeid_t node;
@@ -268,8 +251,10 @@
/* Initialize the entire pgd. */
pgd_init((unsigned long)swapper_pg_dir);
- pmd_init((unsigned long)invalid_pmd_table);
- memset((void *)invalid_pte_table, 0, sizeof(pte_t) * 2 * PTRS_PER_PTE);
+ pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
+ memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE);
+ pmd_init((unsigned long)empty_bad_pmd_table, (unsigned long)empty_bad_page_table);
+ memset((void *)empty_bad_page_table, 0, sizeof(pte_t) * PTRS_PER_PTE);
for (node = 0; node < numnodes; node++) {
pfn_t start_pfn = slot_getbasepfn(node, 0);
@@ -287,7 +272,7 @@
void __init mem_init(void)
{
- extern char _ftext, _etext, _fdata, _edata;
+ extern char _stext, _etext, _fdata, _edata;
extern char __init_begin, __init_end;
extern unsigned long totalram_pages;
extern unsigned long setup_zero_pages(void);
@@ -367,7 +352,7 @@
}
}
- codesize = (unsigned long) &_etext - (unsigned long) &_ftext;
+ codesize = (unsigned long) &_etext - (unsigned long) &_stext;
datasize = (unsigned long) &_edata - (unsigned long) &_fdata;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)