Motorola MCP750 Specifications Page 186

  • Download
  • Add to my manuals
  • Print
  • Page
    / 344
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 185
D
evice Driver Programming
11-12
Upon acquiring the lock, the RW_TRYRDLOCK routine returns the previous priority level.
If the lock is not acquired, the RW_TRYRDLOCK routine returns the value invpl (invalid
IPL).
To acquire a read/write lock in write mode, invoke the RW_WRLOCK routine.
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
pl_t RW_WRLOCK(lockp, pl)
rwlock_t *lockp;
pl_t pl;
where:
lockp is a pointer to the read/write lock to be acquired.
pl is the interrupt priority level to be set while the lock is held by the caller.
Upon acquiring the lock, the RW_WRLOCK routine returns the previous priority level.
To try to acquire a read/write lock in read mode without causing a busy wait if the lock is
unavailable, invoke the RW_TRYWRLOCK routine.
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
pl_t RW_TRYWRLOCK(lockp, pl)
rwlock_t *lockp;
pl_t pl
;
where:
lockp is a pointer to the read/write lock to be acquired.
pl is the interrupt priority level to be set while the lock is held by the caller.
Upon acquiring the lock, the RW_TRYWRLOCK routine returns the previous priority level.
If the lock is not acquired, the RW_TRYWRLOCK routine returns the value invpl (invalid
IPL).
To release a read/write lock, there is a single routine: RW_UNLOCK.
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
void RW_UNLOCK(lockp
,
pl)
rwlock_t *lockp;
pl_t pl
;
where:
lockp is a pointer to the read/write lock to be released.
Page view 185
1 2 ... 181 182 183 184 185 186 187 188 189 190 191 ... 343 344

Comments to this Manuals

No comments