FDD-book/examples/part-07/ch35-async-io/lab02-poll/evdemo.h
Edson Brandi 6e6dac94fe Add book companion files under examples/
Organize companion code and materials by book part:

  part-01/      Foundations
  part-02/      Kernel & driver fundamentals
  part-03/      Character & block devices
  part-04/      Networking & storage
  part-05/      Buses & advanced topics
  part-06/      Debugging & performance
  part-07/      Real-world drivers
  appendices/   Supplementary material
  README.md     Overview and build instructions
2026-04-25 16:51:00 +00:00

26 lines
555 B
C

/*
* evdemo.h - shared user/kernel definitions for the evdemo driver.
*
* The evdemo pseudo-device exposes a queue of synthetic events. This
* header defines the event record that userland reads from the
* /dev/evdemo device node.
*/
#ifndef _EVDEMO_H_
#define _EVDEMO_H_
#include <sys/types.h>
#include <sys/time.h>
struct evdemo_event {
struct timespec ev_time;
uint32_t ev_type;
uint32_t ev_code;
int64_t ev_value;
};
#define EVDEMO_EV_TYPE_TICK 1
#define EVDEMO_EV_TYPE_TRIGGER 2
#define EVDEMO_EV_TYPE_BURST 3
#endif /* _EVDEMO_H_ */