FDD-book/examples/part-05/ch25-advanced/myfirst_log.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

21 lines
490 B
C

/*
* myfirst_log.h - rate-limit state for Chapter 25's logging discipline.
*
* The struct is embedded by value in the softc. myfirst_log.c does
* the attach and detach bookkeeping. DLOG_RL (defined in
* myfirst_debug.h) is the macro that consumes the state.
*/
#ifndef _MYFIRST_LOG_H_
#define _MYFIRST_LOG_H_
#include <sys/time.h>
struct myfirst_ratelimit {
struct timeval rl_lasttime;
int rl_curpps;
};
#define MYF_RL_DEFAULT_PPS 10
#endif /* _MYFIRST_LOG_H_ */