struct scull_dev {
struct scull_qset *data; /* Pointer to first quantum set */
int quantum; /* the current quantum size */
int qset; /* the current array size */
unsigned long size; /* amount of data stored here */
unsigned int access_key; /* used by sculluid and scullpriv */
struct semaphore sem; /* mutual exclusion semaphore */
struct cdev cdev; /* Char device structure */
};
We have already seen the scull_dev structure that represents our device internally.
That structure’s quantum and qset fields hold the device’s quantum and quantum set
sizes, respectively. The actual data, however, is tracked by a different structure,
which we call struct scull_qset:
struct scull_qset {
void **data;
struct scull_qset *next;
};
LDD 3 中的struct原型
最新推荐文章于 2021-09-08 17:16:13 发布