#define __INIT_DELAYED_WORK(_work, _func, _tflags) \ do{ \ INIT_WORK(&(_work)->work, (_func)); \ __setup_timer(&(_work)->timer, delayed_work_timer_fn, \ (unsignedlong)(_work), \ (_tflags) | TIMER_IRQSAFE); \ }while(0) 实例: 1 2 3 4 5 6 7 8 9 10 11 12 1...
*/staticvoid__initdo_basic_setup(void){cpuset_init_smp();// 针对SMP系统,初始化内核control group的cpuset子系统。driver_init();// 初始化设备驱动init_irq_proc();// 创建/proc/irq目录, 并初始化系统中所有中断对应的子目录do_ctors();// 执行内核的构造函数usermodehelper_enable();// 启用usermo...
CPU_DYING_IDLE,(void*)(long)smp_processor_id());smp_mb();/* all activity before dead. */this_cpu_write(cpu_dead_idle,true);arch_cpu_idle_dead();}local_irq_disable();arch_cpu_idle_enter
irq_return: INTERRUPT_RETURN #iret instructionforx86_32 system_call首先会为后续的C函数的调用在当前堆栈中建立参数传递的环境(x86_64的实现要相对复杂一点,它会将系统调用切换到内核栈 movq PER_CPU_VAR(kernel_stack),%rsp),尤其是接下来对C函数sys_execve调用中的struct pt_regs *regs参数,我在上面代码中...
usb_hcd_irq调用了hcd的driver xhci-driver的中断处理函数xhci_irq。hcd是usb core,xhci是usb外设具体的实例。 irqreturn_t usb_hcd_irq (int irq, void *__hcd) { struct usb_hcd *hcd = __hcd; irqreturn_t rc; if (unlikely(HCD_DEAD(hcd) || !HCD_HW_ACCESSIBLE(hcd))) rc = IRQ_NONE; ...
osal_irq.h osal_mem.h osal_mutex.h osal_sem.h osal_spinlock.h osal_thread.h osal_time.h osal_timer.h parameter_item.h parameter.h player.h pms_interface.h pms_types.h poll.h press_event.h pthread.h pwm_if.h recorder.h rect.h regex.h registry.h ...
asmlinkage __visiblevoid__initstart_kernel(void){char*command_line;char*after_dashes;set_task_stack_end_magic(&init_task);smp_setup_processor_id();debug_objects_early_init();cgroup_init_early();local_irq_disable();early_boot_irqs_disabled=true;/* ...
529early_init_irq_lock_class(); 530 531 /* 532* Interrupts are still disabled. Do necessary setups, then 533* enable them 534*/ /*获取大内核锁,锁定整个内核。*/ 535lock_kernel(); /*如果定义了CONFIG_GENERIC_CLOCKEVENTS,则注册clockevents框架*/ ...
usermodehelper_init();// 创建khelper单线程工作队列,用于协助新建和运行用户空间程序shmem_init();// 初始化共享内存driver_init();// 初始化设备驱动init_irq_proc();//创建/proc/irq目录, 并初始化系统中所有中断对应的子目录do_ctors();// 执行内核的构造函数usermodehelper_enable();// 启用usermode...