Lines Matching defs:env_cache

66  * cache (env_cache, board_cache). The caches are created at startup and are
195 * <env_cache> is a cache of all the sensor readings which is persistent
203 * env_cache won't change between the kstat_update and the kstat_snapshot
206 static env_sensor_t *env_cache[SGENV_MAX_HPU_KEYS] = {NULL};
224 * The <env_cache> can be accessed asynchronously by the polling function
891 /* Create thread to ensure env_cache is updated */
918 /* Cause the env_cache thread to terminate. */
1078 * We always return what is in the env_cache. It is up to the SC to ensure
1079 * that the env_cache is current by sending events to us when something
1087 * calls so we use a temporary snapshot of the env_cache. We cannot hold
1090 * the snapshot of the env_cache in the update routine and dump this to the
1143 * We need to take a fresh snapshot of the env_cache here.
1157 * <env_cache> entry should have been allocated
1160 * If this <env_cache> entry is NULL, then
1164 if (env_cache[key_posn] == NULL) {
1171 bcopy(&env_cache[key_posn][0], ptr,
1200 * We have taken a snapshot of the env_cache in the
1504 ASSERT(env_cache[i] != NULL);
1505 ASSERT(env_cache[i][0].sd_id.id.sensor_part ==
1507 ASSERT(env_cache[i][0].sd_id.id.sensor_type ==
1509 ASSERT(SG_INFO_VALUESTATUS(env_cache[i][0].sd_infostamp)
1512 old_key = env_cache[i][0].sd_value;
1523 ASSERT(env_cache[i] == NULL);
1532 * the env_cache. This has the affect of stopping the
1533 * active env_cache writer after they have updated the
1535 * the env_cache, then the env_cache writer can resume
1538 * kstat_read to interrupt the updating of the env_cache.
1548 * the env_cache. (this ensures that data
1573 * (we also need to zero out the env_cache as
1579 * If the <env_cache> has not already been
1583 if (env_cache[i] == NULL) {
1641 * least one HPU in the <env_cache> which could be
1655 ASSERT(env_cache[i] != NULL);
1845 * clear the env_cache. The board must have
1961 ASSERT(env_cache[key_posn] != NULL);
2054 * data returned in the mailbox message into the <env_cache>.
2059 env_cache[key_posn][i].sd_id.tag_id =
2061 env_cache[key_posn][i].sd_lo =
2063 env_cache[key_posn][i].sd_hi =
2067 env_cache[key_posn][i].sd_value =
2069 env_cache[key_posn][i].sd_infostamp =
2072 sgenv_set_sensor_status(&env_cache[key_posn][i]);
2075 env_cache[key_posn][i].sd_lo_warn =
2077 env_cache[key_posn][i].sd_hi_warn =
2097 * Needed to see if we have old data in the <env_cache>.
2139 * If there was no data in the <env_cache>, we need to clear the data
2140 * just added as the <env_cache> will only be partially filled.
2158 if (env_cache[key_posn] != NULL) {
2159 kmem_free(env_cache[key_posn], sizeof (env_sensor_t) *
2161 env_cache[key_posn] = NULL;
2203 * key_posn - The position in the env_cache for which we want to
2219 env_cache[key_posn] = (env_sensor_t *)kmem_zalloc(
2221 if (env_cache[key_posn] == NULL) {
2222 cmn_err(CE_WARN, "Failed to allocate memory for env_cache[%d]",
2228 env_cache[key_posn][i].sd_status = SG_SENSOR_STATUS_OK;
2242 if (env_cache[i] != NULL) {
2243 kmem_free(env_cache[i], sizeof (env_sensor_t) *
2245 env_cache[i] = NULL;
2282 * This function is triggered by the thread that updates the env_cache.
2308 sensor = env_cache[key][i];
2449 * [ When the env_cache is being created, the status of the
2669 * env_cache.
3180 * env_cache and the board_cache to be updated.