block: blk_max_pfn is somtimes wrong
[wrt350n-kernel.git] / include / asm-mips / mach-ip27 / kernel-entry-init.h
blobc1a10314b317ccf441b6a2aba38220e35c3e117a
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2000 Silicon Graphics, Inc.
7 * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org>
8 */
9 #ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H
10 #define __ASM_MACH_IP27_KERNEL_ENTRY_H
12 #include <asm/sn/addrs.h>
13 #include <asm/sn/sn0/hubni.h>
14 #include <asm/sn/klkernvars.h>
17 * Returns the local nasid into res.
19 .macro GET_NASID_ASM res
20 dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID)
21 ld \res, (\res)
22 and \res, NSRI_NODEID_MASK
23 dsrl \res, NSRI_NODEID_SHFT
24 .endm
27 * Intentionally empty macro, used in head.S. Override in
28 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
30 .macro kernel_entry_setup
31 GET_NASID_ASM t1
32 move t2, t1 # text and data are here
33 MAPPED_KERNEL_SETUP_TLB
34 .endm
37 * Do SMP slave processor setup necessary before we can savely execute C code.
39 .macro smp_slave_setup
40 GET_NASID_ASM t1
41 dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
42 KLDIR_OFF_POINTER + CAC_BASE
43 dsll t1, NASID_SHFT
44 or t0, t0, t1
45 ld t0, 0(t0) # t0 points to kern_vars struct
46 lh t1, KV_RO_NASID_OFFSET(t0)
47 lh t2, KV_RW_NASID_OFFSET(t0)
48 MAPPED_KERNEL_SETUP_TLB
49 ARC64_TWIDDLE_PC
50 .endm
52 #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */