/* Check if ptp virtual clock is in use */ staticinlinebool ptp_vclock_in_use(struct ptp_clock *ptp)
{ bool in_use = false;
/* Virtual clocks can't be stacked on top of virtual clocks. *Avoidacquiringthen_vclocks_muxonvirtualclocks,toallowthis *functiontobecalledfromcodepathswherethen_vclocks_muxofthe *parentphysicalclockisalreadyheld.Functionallythat'snotan *issue,butlockdepwouldcomplain,becausetheyhavethesamelock *class.
*/ if (ptp->is_virtual_clock) returnfalse;
if (mutex_lock_interruptible(&ptp->n_vclocks_mux)) returntrue;
if (ptp->n_vclocks)
in_use = true;
mutex_unlock(&ptp->n_vclocks_mux);
return in_use;
}
/* Check if ptp clock shall be free running */ staticinlinebool ptp_clock_freerun(struct ptp_clock *ptp)
{ if (ptp->has_cycles) returnfalse;
return ptp_vclock_in_use(ptp);
}
externconststructclass ptp_class;
/* *seeptp_chardev.c
*/
/* caller must hold pincfg_mux */ int ptp_set_pinfunc(struct ptp_clock *ptp, unsignedint pin, enum ptp_pin_function func, unsignedint chan);
long ptp_ioctl(struct posix_clock_context *pccontext, unsignedint cmd, unsignedlong arg);
int ptp_open(struct posix_clock_context *pccontext, fmode_t fmode);
int ptp_release(struct posix_clock_context *pccontext);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.