linux内核中的__cpu_suspend是在哪里实现的呀?
1. 内核版本
4.19
2. 在arch/arm/kernel/sleep.S中实现如下:
/*
* Save CPU state for a suspend. This saves the CPU general purpose
* registers, and allocates space on the kernel stack to save the CPU
* specific registers and some other data for resume.
* r0 = suspend function arg0
* r1 = suspend function
* r2 = MPIDR value the resuming CPU will use
*/
ENTRY(__cpu_suspend)
stmfd sp!, {r4 - r11, lr}
#ifdef MULTI_CPU
ldr r10, =processor
ldr r4, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
#else
ldr r4, =cpu_suspend_size
#endif
mov r5, sp @ current virtual SP
add r4, r4, # @ Space for pgd, virt sp, phys resume fn
sub sp, sp, r4 @ allocate CPU state on stack
ldr r3, =sleep_save_sp
stmfd sp!, {r0, r1} @ save suspend func arg and pointer
ldr r3, [r3, #SLEEP_SAVE_SP_VIRT]
ALT_SMP(ldr r0, =mpidr_hash)
ALT_UP_B(1f)
/* This ldmia relies on the memory layout of the mpidr_hash struct */
ldmia r0, {r1, r6-r8} @ r1 = mpidr mask (r6,r7,r8) = l[,,] shifts
compute_mpidr_hash r0, r6, r7, r8, r2, r1
add r3, r3, r0, lsl #
: mov r2, r5 @ virtual SP
mov r1, r4 @ size of save block
add r0, sp, # @ pointer to save block
bl __cpu_suspend_save
badr lr, cpu_suspend_abort
ldmfd sp!, {r0, pc} @ call suspend fn
ENDPROC(__cpu_suspend)
linux内核中的__cpu_suspend是在哪里实现的呀?的更多相关文章
- Linux 内核中的 Device Mapper 机制
本文结合具体代码对 Linux 内核中的 device mapper 映射机制进行了介绍.Device mapper 是 Linux 2.6 内核中提供的一种从逻辑设备到物理设备的映射框架机制,在该机 ...
- 向linux内核中添加外部中断驱动模块
本文主要介绍外部中断驱动模块的编写,包括:1.linux模块的框架及混杂设备的注册.卸载.操作函数集.2.中断的申请及释放.3.等待队列的使用.4.工作队列的使用.5.定时器的使用.6.向linux内 ...
- Linux内核中双向链表的经典实现
概要 前面一章"介绍双向链表并给出了C/C++/Java三种实现",本章继续对双向链表进行探讨,介绍的内容是Linux内核中双向链表的经典实现和用法.其中,也会涉及到Linux内核 ...
- Linux内核中的fastcall和asmlinkage宏
代码中看见:#define _fastcall 所以了解下fastcall -------------------------------------------------------------- ...
- Linux内核中的GPIO系统之(3):pin controller driver代码分析
一.前言 对于一个嵌入式软件工程师,我们的软件模块经常和硬件打交道,pin control subsystem也不例外,被它驱动的硬件叫做pin controller(一般ARM soc的datash ...
- (十)Linux内核中的常用宏container_of
Container_of在Linux内核中是一个常用的宏,用于从包含在某个结构中的指针获得结构本身的指针,通俗地讲就是通过结构体变量中某个成员的首地址进而获得整个结构体变量的首地址. Containe ...
- Apparmor——Linux内核中的强制访问控制系统
AppArmor 因为最近在研究OJ(oline judge)后台的安全模块的实现,所以一直在研究Linux下沙箱的东西,同时发现了Apparmor可以提供访问控制. AppArmor(Appli ...
- KSM剖析——Linux 内核中的内存去耦合
简介: 作为一个系统管理程序(hypervisor),Linux® 有几个创新,2.6.32 内核中一个有趣的变化是 KSM(Kernel Samepage Merging) 允许这个系统管理程序通 ...
- linux内核中的get_user和put_user
linux内核中的get_user和put_user 在 内核空间和用户空间交换数据时,get_user和put_user是两个两用的函数.相对于copy_to_user和 copy_from_use ...
随机推荐
- SQL SERVER-邮件配置
存储发邮件 USE msdb GO EXEC sp_send_dbmail @profile_name = 'mail_pro', @recipients='Jinwei.chang@quantacn ...
- Linux误删python导致yum不可用,删除重装方法。
Linux 系统为 CentOS Linux release 7.4.1708 手贱.手贱.手贱 删了python 导致yum不可用.百度一大圈,重装yum和python后,老是报各种各样的错.历经磨 ...
- Django之小结
常用的函数方法与包的调用 # 登陆视图函数 def login(request): if request.method == 'GET': return render(request,'login.h ...
- cdh-hbase用户无法执行命令
- vsftpd设置虚拟用户
centos6.5环境 软件安装: yum install vsftpd db4-utils 1. 添加虚拟用户口令文件 #添加一个虚拟用户testvim /etc/vsftpd/vftp_vuser ...
- yum nginx最新版安装
去官方站点获取yum仓库 [root@web01 ~]# cat /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo baseurl=http:// ...
- python xml文件解析 及生成xml文件
#解析一个database的xml文件 """ <databaselist type="database config"> <dat ...
- MySQL之两张表关系查找例子
teacher表 mysql> select * from teacher; +-----+--------+-----+---------+----------+ | tid | tname ...
- http---返回网页(普通,多进程,多线程,协程方式实现)
代码: import socket import re import multiprocessing import threading import gevent from gevent import ...
- 2019牛客暑期多校训练营(第九场)The power of Fibonacci——循环节&&CRT
题意 求 $\displaystyle \sum_{i=1}^n F_i^m $,($1 \leq n\leq 10^9,1 \leq m\leq 10^3$),答案对 $10^9$ 取模. 分析 ...