PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
Hardware spinlock controller drivers

Interface for hardware spinlock controller drivers. More...

Data Structures

struct  pbl_hwspinlock_controller_ops
 Hardware spinlock controller driver operations, called with interrupts locked. More...
 
struct  pbl_hwspinlock_controller
 A hardware spinlock controller. More...
 

Macros

#define PBL_HWSPINLOCK_CONTROLLER_STATE_DEFINE(sym)   PBL_DEVICE_STATE_DEFINE(sym)
 Define the class state of hardware spinlock controller sym, for the driver's define macro.
 
#define PBL_HWSPINLOCK_CONTROLLER_INIT(sym, _name, _init, _parent, _ops, _num_locks)
 Initializer for the struct pbl_hwspinlock_controller of controller sym.
 

Detailed Description

Interface for hardware spinlock controller drivers.

A driver embeds a struct pbl_hwspinlock_controller in its instance, sets it up with PBL_HWSPINLOCK_CONTROLLER_STATE_DEFINE() and PBL_HWSPINLOCK_CONTROLLER_INIT(), and implements the struct pbl_hwspinlock_controller_ops the class calls.


Data Structure Documentation

◆ pbl_hwspinlock_controller

struct pbl_hwspinlock_controller

A hardware spinlock controller.

Data Fields
struct pbl_device dev Device.
uint16_t num_locks Number of locks.
const struct pbl_hwspinlock_controller_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_HWSPINLOCK_CONTROLLER_INIT

#define PBL_HWSPINLOCK_CONTROLLER_INIT (   sym,
  _name,
  _init,
  _parent,
  _ops,
  _num_locks 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, &pbl_hwspinlock_controller_class), \
.ops = (_ops), \
.num_locks = (_num_locks), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153

Initializer for the struct pbl_hwspinlock_controller of controller sym.

Parameters
symSymbol of the controller instance, with its state defined by PBL_HWSPINLOCK_CONTROLLER_STATE_DEFINE().
_nameName.
_initDevice init function, or NULL.
_parentParent device, or NULL.
_opsDriver operations.
_num_locksNumber of locks.

◆ PBL_HWSPINLOCK_CONTROLLER_STATE_DEFINE

#define PBL_HWSPINLOCK_CONTROLLER_STATE_DEFINE (   sym)    PBL_DEVICE_STATE_DEFINE(sym)

Define the class state of hardware spinlock controller sym, for the driver's define macro.

Parameters
symSymbol of the controller instance.