File tree Expand file tree Collapse file tree 7 files changed +21
-13
lines changed Expand file tree Collapse file tree 7 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
1
#ifndef _X86_APIC_DEFS_H_
2
2
#define _X86_APIC_DEFS_H_
3
3
4
- /*
5
- * Abuse this header file to hold the number of max-cpus and the size of the
6
- * per-CPU stack/data area, making them available both in C and ASM. One page
7
- * for per-CPU, and two pages for the stack (plus some buffer in-between).
8
- */
9
- #define MAX_TEST_CPUS (255)
10
- #define PER_CPU_SIZE (3 * 4096)
11
-
12
4
/*
13
5
* Constants for various Intel APICs. (local APIC, IOAPIC, etc.)
14
6
*
Original file line number Diff line number Diff line change 3
3
4
4
#include <bitops.h>
5
5
#include <stdint.h>
6
+
6
7
#include "apic-defs.h"
8
+ #include "smp.h"
7
9
8
10
extern u8 id_map [MAX_TEST_CPUS ];
9
11
Original file line number Diff line number Diff line change 1
1
#ifndef _X86_SMP_H_
2
2
#define _X86_SMP_H_
3
3
4
+ #define MAX_TEST_CPUS (255)
5
+
6
+ /*
7
+ * Allocate 12KiB of data for per-CPU usage. One page for per-CPU data, and
8
+ * two pages for the stack (plus some buffer in-between).
9
+ */
10
+ #define PER_CPU_SIZE (3 * 4096)
11
+
12
+ /* Address where to store the address of realmode GDT descriptor. */
13
+ #define REALMODE_GDT_LOWMEM (PAGE_SIZE - 2)
14
+
15
+ #ifndef __ASSEMBLER__
16
+
4
17
#include <stddef.h>
5
18
#include <asm/spinlock.h>
6
19
#include "libcflat.h"
7
20
#include "atomic.h"
8
21
#include "apic-defs.h"
9
22
10
- /* Address where to store the address of realmode GDT descriptor. */
11
- #define REALMODE_GDT_LOWMEM (PAGE_SIZE - 2)
12
-
13
23
/* Offsets into the per-cpu page. */
14
24
struct percpu_data {
15
25
uint32_t smp_id ;
@@ -90,4 +100,6 @@ void ap_online(void);
90
100
extern atomic_t cpu_online_count ;
91
101
extern unsigned char online_cpus [(MAX_TEST_CPUS + 7 ) / 8 ];
92
102
103
+ #endif /* __ASSEMBLER__ */
104
+
93
105
#endif
Original file line number Diff line number Diff line change 1
1
2
2
#include "apic-defs.h"
3
+ #include "smp.h"
3
4
4
5
.global online_cpus
5
6
Original file line number Diff line number Diff line change 1
1
#include "apic-defs.h"
2
2
#include "desc.h"
3
+ #include "smp.h"
3
4
4
5
ipi_vector = 0x20
5
6
Original file line number Diff line number Diff line change 3
3
#include "apic-defs.h"
4
4
#include "asm-generic/page.h"
5
5
#include "crt0-efi-x86_64.S"
6
-
6
+ #include "smp.h"
7
7
8
8
/* Reserve stack in .data */
9
9
.data
36
36
.text
37
37
38
38
.code16
39
- REALMODE_GDT_LOWMEM = PAGE_SIZE - 2
40
39
41
40
.globl rm_trampoline
42
41
rm_trampoline:
Original file line number Diff line number Diff line change 3
3
* transition from 32-bit to 64-bit code (x86-64 only)
4
4
*/
5
5
#include "apic-defs.h"
6
+ #include "smp.h"
6
7
7
8
per_cpu_size = PER_CPU_SIZE
8
9
You can’t perform that action at this time.
0 commit comments