今天在“top”發現一個events/0行程CPU資源佔很高。
- Nov 13 Wed 2013 14:38
events/0
- Nov 13 Wed 2013 09:44
三國風雲 - 恢復將
- Nov 13 Wed 2013 09:40
Linux Device Drivers ─ Debug 訊息開關
- Nov 13 Wed 2013 09:34
disable_irq_nosync 與 disable_irq
今天在寫觸控式螢幕驅動時在中斷處理函數中使用disable_irq關中斷發現在進入中斷處理後內核就掛掉了,於是研究了一下才發現disable_irq關閉中斷並等待中斷處理完後返回, 而disable_irq_nosync立即返回. 在中斷處理常式中應該使用disable_irq_nosync來關閉中斷
先看一下disable_irq_nosync,內核代碼中是這樣解釋的:
- Nov 13 Wed 2013 09:30
Static, Shared Dynamic and Loadable Linux Libraries
Why libraries are used: |
This methodology, also known as "shared components" or "archive libraries", groups together multiple compiled object code files into a single file known as a library. Typically C functions/C++ classes and methods which can be shared by more than one application are broken out of the application's source code, compiled and bundled into a library. The C standard libraries and C++ STL are examples of shared components which can be linked with your code. The benefit is that each and every object file need not be stated when linking because the developer can reference the individual library. This simplifies the multiple use and sharing of software components between applications. It also allows application vendors a way to simply release an API to interface with an application. Components which are large can be created for dynamic use, thus the library remain separate from the executable reducing it's size and thus disk space used. The library components are then called by various applications for use when needed.
Linux Library Types: |
There are two Linux C/C++ library types which can be created:
- Static libraries (.a): Library of object code which is linked with, and becomes part of the application.
- Dynamically linked shared object libraries (.so): There is only one form of this library but it can be used in two ways.
- Dynamically linked at run time but statically aware. The libraries must be available during compile/link phase. The shared objects are not included into the executable component but are tied to the execution.
- Dynamically loaded/unloaded and linked during execution (i.e. browser plug-in) using the dynamic linking loader system functions.
Library naming conventions:
Libraries are typically names with the prefix "lib". This is true for all the C standard libraries. When linking, the command line reference to the library will not contain the library prefix or suffix.
- Nov 07 Thu 2013 09:14
/proc/interrupts
3.2.11. /proc/interrupts
This file records the number of interrupts per IRQ on the x86 architecture. A standard /proc/interrupts
looks similar to the following:
CPU0 0: 80448940 XT-PIC timer 1: 174412 XT-PIC keyboard 2: 0 XT-PIC cascade 8: 1 XT-PIC rtc 10: 410964 XT-PIC eth0 12: 60330 XT-PIC PS/2 Mouse 14: 1314121 XT-PIC ide0 15: 5195422 XT-PIC ide1 NMI: 0 ERR: 0
For a multi-processor machine, this file may look slightly different:
CPU0 CPU1 0: 1366814704 0 XT-PIC timer 1: 128 340 IO-APIC-edge keyboard 2: 0 0 XT-PIC cascade 8: 0 1 IO-APIC-edge rtc 12: 5323 5793 IO-APIC-edge PS/2 Mouse 13: 1 0 XT-PIC fpu 16: 11184294 15940594 IO-APIC-level Intel EtherExpress Pro 10/100 Ethernet 20: 8450043 11120093 IO-APIC-level megaraid 30: 10432 10722 IO-APIC-level aic7xxx 31: 23 22 IO-APIC-level aic7xxx NMI: 0 ERR: 0
The first column refers to the IRQ number. Each CPU in the system has its own column and its own number of interrupts per IRQ. The next column reports the type of interrupt, and the last column contains the name of the device that is located at that IRQ.
- Oct 29 Tue 2013 14:31
[Kernel] Linux Kernel 內的 Macro likely() 和 unlikely()
在讀 Linux Permier 中文版的時候. Page 2-41 有一段
使用 likely() 與 unlikely() 巨集透過編譯器告知 CPU 有哪些程式區段不需要預測(likely)或有哪些程式區段需要預測(unlikely).
- Oct 25 Fri 2013 09:04
醫療數位影像傳輸協定(DICOM,Digital Imaging and Communications in Medicine)
- Oct 24 Thu 2013 18:03
The videobuf2 API
- Oct 18 Fri 2013 10:11
Linux ALSA音效卡驅動之七:ASoC架構中的Codec
1. Codec簡介
在移動設備中,Codec的作用可以歸結為4種,分別是:
- 對PCM等信號進行D/A轉換,把數位的音訊信號轉換為類比信號
- 對Mic、Linein或者其他輸入源的類比信號進行A/D轉換,把類比的聲音信號轉變CPU能夠處理的數位信號
- 對音訊通路進行控制,比如播放音樂,收聽調頻收音機,又或者接聽電話時,音訊信號在codec內的流通路線是不一樣的
- 對音訊信號做出相應的處理,例如音量控制,功率放大,EQ控制等等
ASoC 對Codec的這些功能都定義好了一些列相應的介面,以方便地對Codec進行控制。ASoC對Codec驅動的一個基本要求是:驅動程式的程式碼必須要做到平臺無關性,以方便同一個Codec的程式碼不經修改即可用在不同的平臺上。以下的討論基於wolfson的Codec晶片WM8994,kernel的版本3.3.x。