FDD-book/examples/part-07/ch34-advanced-debugging/lab-challenges/leaky-driver/bugdemo.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
468 B
C

/*
* bugdemo.h - Challenge 2 (leaky-driver) shared header.
*/
#ifndef _BUGDEMO_H_
#define _BUGDEMO_H_
#include <sys/ioccom.h>
#include <sys/types.h>
struct bugdemo_command {
uint32_t op;
uint32_t flags;
uint64_t arg;
};
#define BUGDEMO_OP_ALLOC 0
#define BUGDEMO_OP_FREE 1
#define BUGDEMO_OP_STATS 2
#define BUGDEMO_OP_MAX 3
#define BUGDEMO_FLAG_RETURN_EARLY 0x0001
#define BUGDEMO_TRIGGER _IOWR('B', 1, struct bugdemo_command)
#endif /* _BUGDEMO_H_ */