摘要:
1、cpu_number 是一个 percpu 类型的 int 变量, arch/arm64/include/asm/smp.h。 34 行,声明 percpu 变量 cpu_number . 在 arch/arm64/kernel/smp.c 中定义。 2、raw_smp_processor_id 阅读全文
摘要:
include/linux/percpu-defs.h 1、 SHIFT_PERCPU_PTR 230 ~ 231 定义了 SHIFT_PERCPU_PTR ,输入 __p 和 __offset ,直接使用 RELOC_HIDE 对两者进行相加。 RELOC_HIDE 见 https://www.c 阅读全文
摘要:
38 行定义 unsigned long 类型的 __ptr 39 行,将 输入 ptr 的值 放到 __ptr 里面。 40 行,__ptr 里面的值和 offset 的值相加。 但是返回的类型还是 ptr 的类型。 背景: 假设有对象类型 struct people { int age; int 阅读全文