Lines Matching refs:stt

190 smntemp_temp_adjust(smntemp_temp_t *stt)  in smntemp_temp_adjust()  argument
192 if (stt->stt_kind == SMNTEMP_K_TDIE) { in smntemp_temp_adjust()
196 if (THM_CURTEMP_GET_RANGE(stt->stt_raw) == THM_CURTEMP_RANGE_N49_206 || in smntemp_temp_adjust()
197 THM_CURTEMP_GET_TJ_SEL(stt->stt_raw) == THM_CURTEMP_TJ_SEL_RW) { in smntemp_temp_adjust()
205 smntemp_temp_update(smntemp_temp_t *stt) in smntemp_temp_update() argument
211 ASSERT(MUTEX_HELD((&stt->stt_mutex))); in smntemp_temp_update()
213 if ((ret = amdzen_c_smn_read(stt->stt_df->sd_dfno, stt->stt_reg, in smntemp_temp_update()
218 stt->stt_last_read = gethrtime(); in smntemp_temp_update()
219 stt->stt_raw = reg; in smntemp_temp_update()
220 if (stt->stt_kind == SMNTEMP_K_TCTL) { in smntemp_temp_update()
228 raw += smntemp_temp_adjust(stt); in smntemp_temp_update()
230 stt->stt_temp = raw << THM_CURTEMP_TEMP_DEC_BITS; in smntemp_temp_update()
231 stt->stt_temp += decimal; in smntemp_temp_update()
237 smntemp_temp_unit(smntemp_temp_t *stt) in smntemp_temp_unit() argument
239 ASSERT(MUTEX_HELD(&stt->stt_mutex)); in smntemp_temp_unit()
241 if (stt->stt_kind == SMNTEMP_K_TDIE) { in smntemp_temp_unit()
243 } else if (THM_CURTEMP_GET_TJ_SEL(stt->stt_raw) == in smntemp_temp_unit()
255 smntemp_temp_t *stt = arg; in smntemp_temp_read() local
257 mutex_enter(&stt->stt_mutex); in smntemp_temp_read()
258 if ((ret = smntemp_temp_update(stt)) != 0) { in smntemp_temp_read()
259 mutex_exit(&stt->stt_mutex); in smntemp_temp_read()
263 temp->sis_unit = smntemp_temp_unit(stt); in smntemp_temp_read()
264 temp->sis_value = stt->stt_temp; in smntemp_temp_read()
267 mutex_exit(&stt->stt_mutex); in smntemp_temp_read()
279 smntemp_temp_t *stt = arg; in smntemp_temp_kind() local
281 if (stt->stt_kind == SMNTEMP_K_TDIE) { in smntemp_temp_kind()
286 mutex_enter(&stt->stt_mutex); in smntemp_temp_kind()
287 if (stt->stt_raw == 0) { in smntemp_temp_kind()
288 int ret = smntemp_temp_update(stt); in smntemp_temp_kind()
290 mutex_exit(&stt->stt_mutex); in smntemp_temp_kind()
295 if (THM_CURTEMP_GET_TJ_SEL(stt->stt_raw) == THM_CURTEMP_TJ_SEL_TJ) { in smntemp_temp_kind()
302 mutex_exit(&stt->stt_mutex); in smntemp_temp_kind()