forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/mips/include/asm/mach-loongson64/mmzone.h
....@@ -1,52 +1,22 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2010 Loongson Inc. & Lemote Inc. &
34 * Institute of Computing Technology
45 * Author: Xiang Gao, gaoxiang@ict.ac.cn
56 * Huacai Chen, chenhc@lemote.com
67 * Xiaofu Meng, Shuangshuang Zhang
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
128 */
13
-#ifndef _ASM_MACH_MMZONE_H
14
-#define _ASM_MACH_MMZONE_H
9
+#ifndef _ASM_MACH_LOONGSON64_MMZONE_H
10
+#define _ASM_MACH_LOONGSON64_MMZONE_H
1511
16
-#include <boot_param.h>
1712 #define NODE_ADDRSPACE_SHIFT 44
18
-#define NODE0_ADDRSPACE_OFFSET 0x000000000000UL
19
-#define NODE1_ADDRSPACE_OFFSET 0x100000000000UL
20
-#define NODE2_ADDRSPACE_OFFSET 0x200000000000UL
21
-#define NODE3_ADDRSPACE_OFFSET 0x300000000000UL
2213
2314 #define pa_to_nid(addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT)
24
-#define nid_to_addrbase(nid) ((nid) << NODE_ADDRSPACE_SHIFT)
15
+#define nid_to_addrbase(nid) ((unsigned long)(nid) << NODE_ADDRSPACE_SHIFT)
2516
26
-#define LEVELS_PER_SLICE 128
17
+extern struct pglist_data *__node_data[];
2718
28
-struct slice_data {
29
- unsigned long irq_enable_mask[2];
30
- int level_to_irq[LEVELS_PER_SLICE];
31
-};
32
-
33
-struct hub_data {
34
- cpumask_t h_cpus;
35
- unsigned long slice_map;
36
- unsigned long irq_alloc_mask[2];
37
- struct slice_data slice[2];
38
-};
39
-
40
-struct node_data {
41
- struct pglist_data pglist;
42
- struct hub_data hub;
43
- cpumask_t cpumask;
44
-};
45
-
46
-extern struct node_data *__node_data[];
47
-
48
-#define NODE_DATA(n) (&__node_data[(n)]->pglist)
49
-#define hub_data(n) (&__node_data[(n)]->hub)
19
+#define NODE_DATA(n) (__node_data[n])
5020
5121 extern void setup_zero_pages(void);
5222 extern void __init prom_init_numa_memory(void);