locks and semaphores take the form of "get lock-access critical section-release lock".*************************************************************************************************************** **********5. MutexThe mutex and the semaphore are basically the same. Not introduced.Summary: Concurrency and race are widespread, these mechanisms are a good way to solve the problem, interrupt masking is rarely used alone, atomic operations can only be done for integers, so the spin lock and signal
)definitionAmount of Completion:structcompletion com;2)Initialize:Init_completion (com);//If you feel this two-step trouble, you will be given a macro that defines and initializes the declare_completion (COM);3) WaitAmount of Completion:void__sched Wait_for_completion (structCompletion *x);//waiting for a completion to be awakenedint__sched wait_for_completion_interruptible (structCompletion *x);//interruptible wait_for_completionUnsignedLong__sched Wait_for_completion_timeout (structCompletion
kernel
unsigned long copy_to_user (void __user *to, const void * from, unsigned long count)
unsigned long copy_from_user (void *to, const void __user *from, unsigned long count);
Any function that accesses user space must be reentrant, must be able to execute concurrently with other driver functions, and must be in a state that can legally hibernate
Read method
If the return value is equal to the count parameter for passing the read
ZotozoOctober 7
High_wayOctober 7
WangxinOctober 4
Font size: Big medium small blog Linux Device Driver Summary (6): 2. Share interrupt number ()
Category: 6 interruptions
Summary of Linux Device Drivers (6): 2. Share the interrupt number
Bytes
The previous section describes how to call the request_irq () interface to match the interrupt number with the inte
Release date:Updated on: 2013-02-27
Affected Systems:XenSource XenDescription:--------------------------------------------------------------------------------Bugtraq id: 57740CVE (CAN) ID: CVE-2013-0231Xen is an open-source Virtual Machine monitor developed by the University of Cambridge.
On Linux kernel 2.6.18 and 3.8, the pciback_enable_msi function of the Xen PCI backend Driver (drivers/xen/pciback/conf_
network card driver from the IBM official website, use USB stick and other tools to upload to Linux server, then compile
RPM-IVH bnx2-
Cd/root/rpmbuild
RPMBUILD-BB Specs/bnx2.spec
Install the compiled driver package
Cd/root/rpmbuild/rpms/x86_64
RPM-IVH bnx2-
After successful installation, the following path will be displayed:/lib/modules/
Copy the generated module files to the directory:/l
(struct work_struct *work, void (*function) (void *), void *data);
int queue_work (struct workqueue_struct *queue, struct work_struct *work);
int queue_delayed_work (struct workqueue_struct *queue, struct work_struct *work, unsigned long delay);
The return value of the above two functions is nonzero means that the given work_struct structure is already waiting in the queue
int cancel_delayed_work (struct work_struct *work);
The entry
Transferred from: http://blog.chinaunix.net/uid-15724196-id-128140.html2nd Chapter+---------------------------------------------------+| Write a block device driver |+---------------------------------------------------+| Zhao Lei || Email[email protected]|+---------------------------------------------------+| The copyright of the article belongs to the original author. || You are free to reprint this article, but the original copyright information must be retained.| For commercial use, be sure t
# Platform DriverAll device drivers in Linux must be registered to the system platform. This operation is completed by a set of functions defined in platform_device.h. Let's take a look at the struct platform_driver:View plaincopy to clipboardprint? Struct platform_driver {Int (* probe) (struct platform_device *);Int (* remove) (struct platform_device *);Void (* shutdown) (struct platform_device *);Int (* s
-safe version: Unsigned int read_seqbegin_irqsave (seqlock_t *lock, unsigned long flags); int Read_seqretry_irqrestore (seqlock_t *lock,unsigned int seq, unsigned long flags);The writer must obtain a mutex when entering a critical section protected by Seqlock: void Write_seqlock (seqlock_t *lock); void Write_sequnlock (seqlock_t *lock);Since write locks are implemented using spin locks, spin locks control write access, so common variants of the spin lock can be used: void Write_seqlock_irqsave (
This procedure uses the dynamic mapping method to control the LED, the hardware platform is the ok6410 of the Flying LingLed.h: Defining control commands#ifndef _led_h#define _led_h#define led_magic ' M ' #define LED_ON _io (led_magic, 0) #define Led_off _io (LED _magic, 1) #endif Driver LED.C#include Application Led_app.c#include Compile the program, use the command Mknod/dev/leddev C 252 0 To create the device node, the main device number through the Cat/proc/devicesRunning the application
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.