留言板
路过的蜗牛们,在这里留个脚印吧~
蜗窝欢迎各种言论,谈天说地、技术交流、问题求救、跳槽招聘、牢骚抱怨……哈哈。
评论:
CHENYAN
2016-09-27 16:52
2016-09-27 16:52
最近一直在研究ARM64 Linux的系统调用的HOOK方法. 记得以前X86平台下可以通过IDT寄存器获取系统调用表的基地址. 我看了ARM64的内核代码, 貌似没有类似的寄存器. 想问一下ARM64有办法获取系统调用表的基地址吗? 我对ARM64架构不是很熟悉, 能给点指导意见吗? 感谢!!! @wowo
hongxiaoh
2016-08-11 14:16
2016-08-11 14:16
cec = atomic_add_return(MAX_IN_PROGRESS, &combined_event_count);
wakeup events in progress减1,registered wakeup events加1
请问这个具体是怎么实现加减的?
wakeup events in progress减1,registered wakeup events加1
请问这个具体是怎么实现加减的?
wowo
2016-08-11 15:42
2016-08-11 15:42
@hongxiaoh:假设combined_event_count是32bit
wakeup events in progress和registered wakeup events各占16bit,即:wakeup events in progress | registered wakeup events.
注:上面有一个隐含的规则:registered wakeup events > wakeup events in progress(很重要,不然会有问题)
而MAX_IN_PROGRESS等于((1 << 16) - 1),即0xffff
那么combined_event_count + MAX_IN_PROGRESS = ?
假设combined_event_count=0x0 0001,则为0x1 0000
假设combined_event_count=0x5 0009,则为0x6 0008
实际上就利用了简单的进位操作~~~
wakeup events in progress和registered wakeup events各占16bit,即:wakeup events in progress | registered wakeup events.
注:上面有一个隐含的规则:registered wakeup events > wakeup events in progress(很重要,不然会有问题)
而MAX_IN_PROGRESS等于((1 << 16) - 1),即0xffff
那么combined_event_count + MAX_IN_PROGRESS = ?
假设combined_event_count=0x0 0001,则为0x1 0000
假设combined_event_count=0x5 0009,则为0x6 0008
实际上就利用了简单的进位操作~~~
hongxiaoh
2016-08-30 13:46
2016-08-30 13:46
@wowo:#define pr_fmt(fmt) "%s: " fmt, __func__
请问知道这句话的语法吗??
在linux lcd驱动看到的这句话。
请问知道这句话的语法吗??
在linux lcd驱动看到的这句话。
wowo
2016-08-30 18:19
2016-08-30 18:19
@hongxiaoh:pr_fmt是为了在printk输出的log之前,加一些关键字,一般是标识自己的模块的(一次都是放在自己模块C代码的开始处),你可以参考include/linux/printk.h中的用法,如:
#define pr_info(fmt, ...) \
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
#define pr_info(fmt, ...) \
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
wowo
2016-09-06 17:23
2016-09-06 17:23
@hongxiaoh:不知道你使用哪个版本的Android?
以我了解的Android5.0为例,关机充电和正常工作,从本质上来讲,是没有什么区别的,只是运行了不同的Application(例如healthd),此时Adb的service和protocol,很有可能是存在的(依赖Android的配置),如果你需要查看日志,估计需要把相应的环境(如logcat等)启动:
例如下面是我的机器在关机充电的时候的打印(没有shell、没有logcat等等)
adb logcat
- exec '/system/bin/sh' failed: No such file or directory (2) -
具体怎么做,和Android的版本、编译、配置策略有关,具体我也不是很熟悉~~
以我了解的Android5.0为例,关机充电和正常工作,从本质上来讲,是没有什么区别的,只是运行了不同的Application(例如healthd),此时Adb的service和protocol,很有可能是存在的(依赖Android的配置),如果你需要查看日志,估计需要把相应的环境(如logcat等)启动:
例如下面是我的机器在关机充电的时候的打印(没有shell、没有logcat等等)
adb logcat
- exec '/system/bin/sh' failed: No such file or directory (2) -
具体怎么做,和Android的版本、编译、配置策略有关,具体我也不是很熟悉~~
likai
2016-08-05 11:16
2016-08-05 11:16
qcom,power-on@800 {
compatible = "qcom,qpnp-power-on";
reg = <0x800 0x100>;
interrupts = <0x0 0x8 0x0>,
<0x0 0x8 0x1>,
<0x0 0x8 0x4>,
<0x0 0x8 0x5>;//这个代表的什么含义呢?
interrupt-names = "kpdpwr", "resin",
"resin-bark", "kpdpwr-resin-bark";
qcom,pon-dbc-delay = <15625>;
qcom,system-reset;
qcom,pon_1 {
qcom,pon-type = <0>;
qcom,pull-up = <1>;
linux,code = <116>;
};
qcom,pon_2 {
qcom,pon-type = <1>;
qcom,pull-up = <1>;
linux,code = <114>;
};
qcom,pon_3 {
qcom,pon-type = <3>;
qcom,support-reset = <1>;
qcom,s1-timer = <6720>;
qcom,s2-timer = <2000>;
qcom,s2-type = <7>;
qcom,pull-up = <1>;
qcom,use-bark;
};
};
我有一个疑问,可否帮忙解答解答。interrupts = <0x0 0x8 0x0> 代表的都是什么含义呢,非常感谢。
compatible = "qcom,qpnp-power-on";
reg = <0x800 0x100>;
interrupts = <0x0 0x8 0x0>,
<0x0 0x8 0x1>,
<0x0 0x8 0x4>,
<0x0 0x8 0x5>;//这个代表的什么含义呢?
interrupt-names = "kpdpwr", "resin",
"resin-bark", "kpdpwr-resin-bark";
qcom,pon-dbc-delay = <15625>;
qcom,system-reset;
qcom,pon_1 {
qcom,pon-type = <0>;
qcom,pull-up = <1>;
linux,code = <116>;
};
qcom,pon_2 {
qcom,pon-type = <1>;
qcom,pull-up = <1>;
linux,code = <114>;
};
qcom,pon_3 {
qcom,pon-type = <3>;
qcom,support-reset = <1>;
qcom,s1-timer = <6720>;
qcom,s2-timer = <2000>;
qcom,s2-type = <7>;
qcom,pull-up = <1>;
qcom,use-bark;
};
};
我有一个疑问,可否帮忙解答解答。interrupts = <0x0 0x8 0x0> 代表的都是什么含义呢,非常感谢。
wowo
2016-08-05 12:27
2016-08-05 12:27
@likai:你可以参考对应的device tree bindings文档,例如(这里不一定是你的真实场景。另外如果找不到文档,可以直接看代码,我们不知道你的平台,具体的含义也无法确定):
Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt
- #interrupt-cells : Specifies the number of cells needed to encode an
interrupt source. The type shall be a <u32> and the value shall be 3.
The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
interrupts.
The 2nd cell contains the interrupt number for the interrupt type.
SPI interrupts are in the range [0-987]. PPI interrupts are in the
range [0-15].
The 3rd cell is the flags, encoded as follows:
bits[3:0] trigger type and level flags.
1 = low-to-high edge triggered
2 = high-to-low edge triggered (invalid for SPIs)
4 = active high level-sensitive
8 = active low level-sensitive (invalid for SPIs).
bits[15:8] PPI interrupt cpu mask. Each bit corresponds to each of
the 8 possible cpus attached to the GIC. A bit set to '1' indicated
the interrupt is wired to that CPU. Only valid for PPI interrupts.
Also note that the configurability of PPI interrupts is IMPLEMENTATION
DEFINED and as such not guaranteed to be present (most SoC available
in 2014 seem to ignore the setting of this flag and use the hardware
default value).
Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt
- #interrupt-cells : Specifies the number of cells needed to encode an
interrupt source. The type shall be a <u32> and the value shall be 3.
The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
interrupts.
The 2nd cell contains the interrupt number for the interrupt type.
SPI interrupts are in the range [0-987]. PPI interrupts are in the
range [0-15].
The 3rd cell is the flags, encoded as follows:
bits[3:0] trigger type and level flags.
1 = low-to-high edge triggered
2 = high-to-low edge triggered (invalid for SPIs)
4 = active high level-sensitive
8 = active low level-sensitive (invalid for SPIs).
bits[15:8] PPI interrupt cpu mask. Each bit corresponds to each of
the 8 possible cpus attached to the GIC. A bit set to '1' indicated
the interrupt is wired to that CPU. Only valid for PPI interrupts.
Also note that the configurability of PPI interrupts is IMPLEMENTATION
DEFINED and as such not guaranteed to be present (most SoC available
in 2014 seem to ignore the setting of this flag and use the hardware
default value).
wowo
2016-06-17 10:25
2016-06-17 10:25
mobz兄,一早看到您的留言,非常感激,能用心向蜗窝提意见的人,是真心关心蜗窝的人,多谢了。
我觉得,这个意见,很好、很尖锐、也很矛盾。我需要小心的回答,也欢迎更多的人留言讨论(为了方便,我把它转移到留言板了),讨论的结果,我会更新到“关于蜗窝”页面。
有一点需要更正一下,蜗窝不仅仅是“一个主要针对linux内核和驱动深入研究的地方”。因为技术是相通的,不应该有界限。无论是linux kernel、还是RTOS、还是应用软件,无论是软件设计、还是硬件设计、还是产品设计,其背后的指导思想都是相同的。
从表面看,蜗窝为大家分享了很多技术文章,有些文章可能帮到了某些人,但这并不是蜗窝的直接目的(因此CSDN不是蜗窝的榜样)。
蜗窝的直接目的,是通过整理、分享一些文章,以便加深自己的理解,提升自己的能力。
在这个基础上,如果我们整理、分享出来的这些文章,条理和逻辑足够清晰,以至于可以启发、帮助到他人,就再好不过了,就当是利己利人吧。
隐藏在这背后的,就是蜗窝的理念,以及一直没敢说出来的目标(太宏大、太困难、太不切实际,因此怕被笑话),就是改变国内的技术氛围,改变从业者对待技术、对待自己所从事的工作以及对待自己的态度。
怎么改变呢?从对待技术和工作的态度做起:沉得住气,细致、认真,善于总结,善于刨根问底,能够认同所从事的工作,并从中获得愉悦感和充实感。
这就是蜗窝一直鼓励大家分享的原因所在,分享是到达这个目的的第一步,从不假思索的索取模式,转换为思考模式,哪怕思考的过程只有自己能懂,也足够了(达者兼济天下 穷者独善其身)。
最后,就是分享的质量了,说实话,我也很矛盾。正如您所说,linuxer和我写的一些文章,虽然不是特别好,但也不算差,在百度和谷歌的搜索排名,基本上都是第一页,这是蜗窝的荣幸,但我们不应满足于此。
因此,对于其他同学的分享,我们的要求很简单,原创+有自己的思考,至少能把自己写明白,最好能坚持、有进步。当然,有些可能对蜗窝有影响,希望大家宽容对待。
也希望迈出第一步和大家分享的同学,把压力转化为动力,精益求精,像对待知己、恋人、孩子一样,对待自己的文字。
我觉得,这个意见,很好、很尖锐、也很矛盾。我需要小心的回答,也欢迎更多的人留言讨论(为了方便,我把它转移到留言板了),讨论的结果,我会更新到“关于蜗窝”页面。
有一点需要更正一下,蜗窝不仅仅是“一个主要针对linux内核和驱动深入研究的地方”。因为技术是相通的,不应该有界限。无论是linux kernel、还是RTOS、还是应用软件,无论是软件设计、还是硬件设计、还是产品设计,其背后的指导思想都是相同的。
从表面看,蜗窝为大家分享了很多技术文章,有些文章可能帮到了某些人,但这并不是蜗窝的直接目的(因此CSDN不是蜗窝的榜样)。
蜗窝的直接目的,是通过整理、分享一些文章,以便加深自己的理解,提升自己的能力。
在这个基础上,如果我们整理、分享出来的这些文章,条理和逻辑足够清晰,以至于可以启发、帮助到他人,就再好不过了,就当是利己利人吧。
隐藏在这背后的,就是蜗窝的理念,以及一直没敢说出来的目标(太宏大、太困难、太不切实际,因此怕被笑话),就是改变国内的技术氛围,改变从业者对待技术、对待自己所从事的工作以及对待自己的态度。
怎么改变呢?从对待技术和工作的态度做起:沉得住气,细致、认真,善于总结,善于刨根问底,能够认同所从事的工作,并从中获得愉悦感和充实感。
这就是蜗窝一直鼓励大家分享的原因所在,分享是到达这个目的的第一步,从不假思索的索取模式,转换为思考模式,哪怕思考的过程只有自己能懂,也足够了(达者兼济天下 穷者独善其身)。
最后,就是分享的质量了,说实话,我也很矛盾。正如您所说,linuxer和我写的一些文章,虽然不是特别好,但也不算差,在百度和谷歌的搜索排名,基本上都是第一页,这是蜗窝的荣幸,但我们不应满足于此。
因此,对于其他同学的分享,我们的要求很简单,原创+有自己的思考,至少能把自己写明白,最好能坚持、有进步。当然,有些可能对蜗窝有影响,希望大家宽容对待。
也希望迈出第一步和大家分享的同学,把压力转化为动力,精益求精,像对待知己、恋人、孩子一样,对待自己的文字。
electrlife
2016-08-25 12:48
2016-08-25 12:48
@wowo:Hi,我很好奇版主是从事什么行业的,具体的工作职责是什么,如何练就这样的胸怀与思想?
真的很是佩服!每每想到我何时在linux 方面也能有这样的造诣!就感觉很渺茫!因为不懂所以觉得Linux 真的很神奇,程序的结构真的很值得学习!但最近找工作确又给我泼冷水,做Linux 驱动的公司一般开的工资都在2万以内,感觉和Linux 的高大上完全不符!或者是说确实自己的水平太低了!
真的很是佩服!每每想到我何时在linux 方面也能有这样的造诣!就感觉很渺茫!因为不懂所以觉得Linux 真的很神奇,程序的结构真的很值得学习!但最近找工作确又给我泼冷水,做Linux 驱动的公司一般开的工资都在2万以内,感觉和Linux 的高大上完全不符!或者是说确实自己的水平太低了!
功能
最新评论
文章分类
随机文章
文章存档
- 2024年2月(1)
- 2023年5月(1)
- 2022年10月(1)
- 2022年8月(1)
- 2022年6月(1)
- 2022年5月(1)
- 2022年4月(2)
- 2022年2月(2)
- 2021年12月(1)
- 2021年11月(5)
- 2021年7月(1)
- 2021年6月(1)
- 2021年5月(3)
- 2020年3月(3)
- 2020年2月(2)
- 2020年1月(3)
- 2019年12月(3)
- 2019年5月(4)
- 2019年3月(1)
- 2019年1月(3)
- 2018年12月(2)
- 2018年11月(1)
- 2018年10月(2)
- 2018年8月(1)
- 2018年6月(1)
- 2018年5月(1)
- 2018年4月(7)
- 2018年2月(4)
- 2018年1月(5)
- 2017年12月(2)
- 2017年11月(2)
- 2017年10月(1)
- 2017年9月(5)
- 2017年8月(4)
- 2017年7月(4)
- 2017年6月(3)
- 2017年5月(3)
- 2017年4月(1)
- 2017年3月(8)
- 2017年2月(6)
- 2017年1月(5)
- 2016年12月(6)
- 2016年11月(11)
- 2016年10月(9)
- 2016年9月(6)
- 2016年8月(9)
- 2016年7月(5)
- 2016年6月(8)
- 2016年5月(8)
- 2016年4月(7)
- 2016年3月(5)
- 2016年2月(5)
- 2016年1月(6)
- 2015年12月(6)
- 2015年11月(9)
- 2015年10月(9)
- 2015年9月(4)
- 2015年8月(3)
- 2015年7月(7)
- 2015年6月(3)
- 2015年5月(6)
- 2015年4月(9)
- 2015年3月(9)
- 2015年2月(6)
- 2015年1月(6)
- 2014年12月(17)
- 2014年11月(8)
- 2014年10月(9)
- 2014年9月(7)
- 2014年8月(12)
- 2014年7月(6)
- 2014年6月(6)
- 2014年5月(9)
- 2014年4月(9)
- 2014年3月(7)
- 2014年2月(3)
- 2014年1月(4)
2016-12-23 13:45
的中断是否打开?
我知道查看本核的是irq_disabled()