cpu 执行断点指令时,会触发内核的断点处理函数「do_int3」,它判断是否为 kprobe 引起的断点,如果是 kprobe 机制触发的断点,会保存这个程序的状态,比如寄存器、堆栈等信息,并通过 Linux 的「notifier_call_chain」机制,将 cpu 的使用权交给之前 kprobe 的 probe handler,同时会把内核所保存的寄存器、堆栈信息传递给 ...
return 1; if (!ret) return 0; } head = this_cpu_ptr(call->perf_events); if (hlist_empty(head)) return 0; dsize = __get_data_size(&tk->tp, regs); __size = sizeof(*entry) + tk->tp.size + dsize; size = ALIGN(__size + sizeof(u32), sizeof(u64)); size -= sizeo...
list=__this_cpu_read(tasklet_hi_vec.head); __this_cpu_write(tasklet_hi_vec.head, NULL); __this_cpu_write(tasklet_hi_vec.tail, this_cpu_ptr(&tasklet_hi_vec.head)); local_irq_enable();/** 遍历运行链表中的所有tasklet*/while(list)/** 通过标志位TASKLET_STATE_SCHED判断本tasklet有没...
cpu)//获取per-cpu变量的值this_cpu_ptr(ptr)//获取当前per-cpu变量的地址get_cpu_var(var)//获取当前per-cpu变量的值get_cpu_ptr(var)//禁止抢占,并返回当前处理器变量的副本的地址put_cpu_ptr(var)//开启抢占,这两个宏需要配对使用,以确保获取per-cpu变量时不会被其它进程抢占get_cpu_var(var)//禁止...
2.CPU,这里指的是一个CPU向另一个CPU发送中断,这种中断叫做IPI(处理器间中断)。IPI也可以看出是一种特殊的硬件中断,因为它和硬件中断的模式差不多,都是异步的。 3.CPU异常,CPU在执行指令的过程中发现异常会向自己发送中断信号,这种中断是同步的,一般也叫做软件中断(注意软中断是另外一个概念)。CPU异常按照是否...
(.vectors) /* 中断向量表 */CPUDIR/start.o (.text*) /* CPUDIR/start.o 中的所有.text 段 */}/* This needs to come before *(.text*) */.__efi_runtime_start : {*(.__efi_runtime_start)}.efi_runtime : {*(.text.efi_runtime*)*(.rodata.efi_runtime*)*(.data.efi_runtime...
!(gfp_flags & __GFP_COLD); again: if (likely(order == 0)) { struct per_cpu_pages *pcp; struct list_head *list; local_irq_save(flags); pcp = &this_cpu_ptr(zone->pageset)->pcp; list = &pcp->lists[migratetype]; if (list_empty(list)) { pcp->count += rmqueue_bulk(zone...
系统调用通过CPU的寄存器来进行参数传递。在进行系统调用之前,系统调用的参数被写入CPU的寄存器,而在实际调用系统服务例程之前,内核将CPU寄存器的内容拷贝到内核堆栈中,实现参数的传递。 因此不同的体系结构可能采用不同的方式或者不同的寄存器来传递参数,而上面函数的任务就是从处理器的寄存器中提取用户空间提供的信息, ...
// __get_cpu_var 用于获取属于这个 CPU 的 structure softnet_data 变量 ___napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); } staticinlinevoid___napi_schedule(struct softnet_data *sd, struct napi_struct *napi) { ...
以qcom 8核armv8的SOC为例,把cpu本地定时器称为arch_timer,全局计数器System counter不需要专门的dts节点,配置如下: 1 2 3 4 5 6 7 8 9 arch_timer: timer { compatible = "arm,armv8-timer"; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, ...