diff options
Diffstat (limited to 'usr/src/uts/common/os/sunpm.c')
-rw-r--r-- | usr/src/uts/common/os/sunpm.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/usr/src/uts/common/os/sunpm.c b/usr/src/uts/common/os/sunpm.c index 84c0b9fbb6..7570cd29e6 100644 --- a/usr/src/uts/common/os/sunpm.c +++ b/usr/src/uts/common/os/sunpm.c @@ -591,13 +591,14 @@ pm_init_locks(void) cv_init(&pm_dep_thread_cv, NULL, CV_DEFAULT, NULL); } +static int pm_reset_timestamps(dev_info_t *, void *); + static boolean_t pm_cpr_callb(void *arg, int code) { _NOTE(ARGUNUSED(arg)) static int auto_save; static pm_cpupm_t cpupm_save; - static int pm_reset_timestamps(dev_info_t *, void *); switch (code) { case CB_CODE_CPR_CHKPT: @@ -664,6 +665,8 @@ pm_halt_callb(void *arg, int code) return (B_TRUE); } +static void pm_dep_thread(void); + /* * This needs to be called after the root and platform drivers are loaded * and be single-threaded with respect to driver attach/detach @@ -674,7 +677,6 @@ pm_init(void) PMD_FUNC(pmf, "pm_init") char **mod; extern pri_t minclsyspri; - static void pm_dep_thread(void); pm_comps_notlowest = 0; pm_system_idle_threshold = pm_default_idle_threshold; @@ -847,6 +849,7 @@ e_pm_valid_power(dev_info_t *dip, int cmpt, int level) return (0); } +static int pm_start(dev_info_t *dip); /* * Returns true if device is pm'd (after calling pm_start if need be) */ @@ -854,7 +857,6 @@ int e_pm_valid_info(dev_info_t *dip, pm_info_t **infop) { pm_info_t *info; - static int pm_start(dev_info_t *dip); /* * Check if the device is power managed if not. @@ -1171,6 +1173,9 @@ pm_noinvol(dev_info_t *dip) return (DEVI(dip)->devi_pm_noinvolpm != DEVI(dip)->devi_pm_volpmd); } +static int cur_threshold(dev_info_t *, int); +static int pm_next_lower_power(pm_component_t *, int); + /* * This function performs the actual scanning of the device. * It attempts to power off the indicated device's components if they have @@ -1193,8 +1198,6 @@ pm_scan_dev(dev_info_t *dip) pm_component_t *cp; dev_info_t *pdip = ddi_get_parent(dip); int circ; - static int cur_threshold(dev_info_t *, int); - static int pm_next_lower_power(pm_component_t *, int); clock_t min_scan = pm_default_min_scan; /* @@ -2454,6 +2457,8 @@ e_pm_set_cur_pwr(dev_info_t *dip, pm_component_t *cp, int level) cp->pmc_cur_pwr = pm_level_to_index(dip, cp, level); } +static int pm_phc_impl(dev_info_t *, int, int, int); + /* * This is the default method of setting the power of a device if no ppm * driver has claimed it. @@ -2467,7 +2472,6 @@ pm_power(dev_info_t *dip, int comp, int level) struct pm_component *cp = PM_CP(dip, comp); int retval; pm_info_t *info = PM_GET_PM_INFO(dip); - static int pm_phc_impl(dev_info_t *, int, int, int); PMD(PMD_KIDSUP, ("%s: %s@%s(%s#%d), comp=%d, level=%d\n", pmf, PM_DEVICE(dip), comp, level)) @@ -2922,6 +2926,8 @@ pm_watchers() return (pm_pscc_direct || pm_pscc_interest); } +static int pm_phc_impl(dev_info_t *, int, int, int); + /* * A driver is reporting that the power of one of its device's components * has changed. Update the power state accordingly. @@ -2934,7 +2940,6 @@ pm_power_has_changed(dev_info_t *dip, int comp, int level) dev_info_t *pdip = ddi_get_parent(dip); struct pm_component *cp; int blocked, circ, pcirc, old_level; - static int pm_phc_impl(dev_info_t *, int, int, int); if (level < 0) { PMD(PMD_FAIL, ("%s: %s@%s(%s#%d): bad level=%d\n", pmf, @@ -3755,6 +3760,8 @@ pm_all_at_normal(dev_info_t *dip) return (1); } +static void bring_pmdep_up(dev_info_t *, int); + static void bring_wekeeps_up(char *keeper) { @@ -3764,7 +3771,6 @@ bring_wekeeps_up(char *keeper) pm_info_t *wku_info; char *kept_path; dev_info_t *kept; - static void bring_pmdep_up(dev_info_t *, int); if (panicstr) { return; @@ -5559,6 +5565,8 @@ pm_interest_registered(int clone) return (pm_interest[clone]); } +static void pm_enqueue_pscc(pscc_t *, pscc_t **); + /* * Process with clone has just done PM_DIRECT_PM on dip, or has asked to * watch all state transitions (dip == NULL). Set up data @@ -5569,7 +5577,6 @@ pm_register_watcher(int clone, dev_info_t *dip) { pscc_t *p; psce_t *psce; - static void pm_enqueue_pscc(pscc_t *, pscc_t **); /* * We definitely need a control struct, then we have to search to see @@ -5781,13 +5788,13 @@ pm_psc_find_clone(int clone, pscc_t **list, krwlock_t *lock) return (NULL); } +static psce_t *pm_psc_find_clone(int, pscc_t **, krwlock_t *); /* * Find an entry for a particular clone in the direct list. */ psce_t * pm_psc_clone_to_direct(int clone) { - static psce_t *pm_psc_find_clone(int, pscc_t **, krwlock_t *); return (pm_psc_find_clone(clone, &pm_pscc_direct, &pm_pscc_direct_rwlock)); } @@ -5798,7 +5805,6 @@ pm_psc_clone_to_direct(int clone) psce_t * pm_psc_clone_to_interest(int clone) { - static psce_t *pm_psc_find_clone(int, pscc_t **, krwlock_t *); return (pm_psc_find_clone(clone, &pm_pscc_interest, &pm_pscc_interest_rwlock)); } @@ -7860,6 +7866,8 @@ pm_cfb_trigger(void) ddi_trigger_softintr(pm_soft_id); } +static major_t i_path_to_major(char *, char *); + major_t pm_path_to_major(char *path) { @@ -7867,7 +7875,6 @@ pm_path_to_major(char *path) char *np, *ap, *bp; major_t ret; size_t len; - static major_t i_path_to_major(char *, char *); PMD(PMD_NOINVOL, ("%s: %s\n", pmf, path)) @@ -8088,6 +8095,8 @@ i_path_to_major(char *path, char *leaf_name) return (maj); } +static void i_pm_driver_removed(major_t major); + /* * When user calls rem_drv, we need to forget no-involuntary-power-cycles state * An entry in the list means that the device is detached, so we need to @@ -8097,7 +8106,6 @@ i_path_to_major(char *path, char *leaf_name) void pm_driver_removed(major_t major) { - static void i_pm_driver_removed(major_t major); /* * Serialize removal of drivers. This is to keep ancestors of @@ -8109,6 +8117,10 @@ pm_driver_removed(major_t major) mutex_exit(&pm_remdrv_lock); } +static void adjust_ancestors(char *, int); +static int pm_is_noinvol_ancestor(pm_noinvol_t *); +static void pm_noinvol_process_ancestors(char *); + /* * This routine is called recursively by pm_noinvol_process_ancestors() */ @@ -8116,9 +8128,6 @@ static void i_pm_driver_removed(major_t major) { PMD_FUNC(pmf, "driver_removed") - static void adjust_ancestors(char *, int); - static int pm_is_noinvol_ancestor(pm_noinvol_t *); - static void pm_noinvol_process_ancestors(char *); pm_noinvol_t *ip, *pp = NULL; int wasvolpmd; ASSERT(major != DDI_MAJOR_T_NONE); |