]> git.corax.cc Git - corax/commitdiff
Move CPU_ID macro to kernel/include/arch.h
authorMatthias Kruk <m@m10k.eu>
Mon, 3 Feb 2020 22:26:28 +0000 (07:26 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 3 Feb 2020 22:26:28 +0000 (07:26 +0900)
kernel/arch/cpu.h
kernel/include/arch.h

index da1062add15b68ab8c07d7bbee7da48485dcbd94..9746a4d9306771a99de357b7ef616b0d3a69e422 100644 (file)
@@ -118,18 +118,6 @@ struct cpu {
     struct task             *cpu_task;
 } __attribute__((packed));
 
-#if defined(CONFIG_SMP) && CONFIG_SMP_CPUS > 1
-
-int cpu_get_id(void);
-#define CPU_ID  cpu_get_id()
-
-#else
-
-#define CPU_ID  0
-
-#endif /* CONFIG_SMP */
-
-
 void _segment_descriptor_set(segment_descriptor_t*, u32_t, u32_t, u32_t, u32_t);
 
 #endif /* __CPU_H */
index 9707be80d7db38f85ad6a9f4d82cd17c6216a654..4741ab29c70eb8a3d1f289f08721e2b0efa83b24 100644 (file)
@@ -142,6 +142,12 @@ struct region {
        u32_t reg_refs;
 };
 
+#if FEATURE(SMP) && FEATURE(APIC)
+#define CPU_ID cpu_get_id()
+#else /* !(FEATURE(SMP) && FEATURE(APIC)) */
+#define CPU_ID 0
+#endif /* !(FEATURE(SMP) && FEATURE(APIC)) */
+
 int     cpu_get_id(void);
 u64_t   cpu_get_capabilities(void);
 u64_t   cpu_timestamp(void);
@@ -206,7 +212,7 @@ int     pg_dir_create(pg_dir_t**);
  *  The number of pages that will be mapped depends on the page directory. If
  *  PAE-mode paging is employed, pg_dir_map() will attempt to map pages of the
  *  largest-possible size, meaning that it will attempt to map 4M pages if the
- *  alignment of the addresses and the page directory's page size permitts.
+ *  alignment of the addresses and the page directory's page size permits.
  *  Any pages that have been mapped into the page directory will have their
  *  page attributes set according to the value passed in `attrs'.
  *  The PAGE_ATTR_PRESENT will be set regardless of the value in `attrs'.