/* name of the device, usually in /dev */ #define UV_MMTIMER_NAME "mmtimer" #define UV_MMTIMER_DESC "SGI UV Memory Mapped RTC Timer" #define UV_MMTIMER_VERSION "1.0"
switch (cmd) { case MMTIMER_GETOFFSET: /* offset of the counter */ /* *StartingwithHUBrev2.0,theUVRTCregisteris *replicatedacrossallcachelinesofit'sownpage. *Thisallowsfastersimultaneousreadsfromagivensocket. * *Theoffsetreturnedisin64bitunits.
*/ if (uv_get_min_hub_revision_id() == 1)
ret = 0; else
ret = ((uv_blade_processor_id() * L1_CACHE_BYTES) %
PAGE_SIZE) / 8; break;
case MMTIMER_GETRES: /* resolution of the clock in 10^-15 s */ if (copy_to_user((unsignedlong __user *)arg,
&uv_mmtimer_femtoperiod, sizeof(unsignedlong)))
ret = -EFAULT; break;
case MMTIMER_GETFREQ: /* frequency in Hz */ if (copy_to_user((unsignedlong __user *)arg,
&sn_rtc_cycles_per_second, sizeof(unsignedlong)))
ret = -EFAULT; break;
case MMTIMER_GETBITS: /* number of bits in the clock */
ret = hweight64(UVH_RTC_REAL_TIME_CLOCK_MASK); break;
case MMTIMER_MMAPAVAIL:
ret = 1; break;
case MMTIMER_GETCOUNTER: if (copy_to_user((unsignedlong __user *)arg,
(unsignedlong *)uv_local_mmr_address(UVH_RTC), sizeof(unsignedlong)))
ret = -EFAULT; break; default:
ret = -ENOTTY; break;
} return ret;
}
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.