diff options
Diffstat (limited to 'usr/src/uts/common/sys')
-rw-r--r-- | usr/src/uts/common/sys/Makefile | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/asy.h | 18 | ||||
-rw-r--r-- | usr/src/uts/common/sys/audio/impl/audio810_impl.h | 14 | ||||
-rw-r--r-- | usr/src/uts/common/sys/cpr.h | 49 | ||||
-rw-r--r-- | usr/src/uts/common/sys/cpuvar.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dktp/cmdk.h | 24 | ||||
-rw-r--r-- | usr/src/uts/common/sys/dktp/dadk.h | 6 | ||||
-rw-r--r-- | usr/src/uts/common/sys/epm.h | 118 | ||||
-rw-r--r-- | usr/src/uts/common/sys/pm.h | 38 | ||||
-rw-r--r-- | usr/src/uts/common/sys/ppmvar.h | 13 | ||||
-rw-r--r-- | usr/src/uts/common/sys/rtc.h | 12 | ||||
-rw-r--r-- | usr/src/uts/common/sys/srn.h | 79 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sunddi.h | 6 | ||||
-rw-r--r-- | usr/src/uts/common/sys/uadmin.h | 17 |
14 files changed, 368 insertions, 28 deletions
diff --git a/usr/src/uts/common/sys/Makefile b/usr/src/uts/common/sys/Makefile index 75060a7a15..4cd97b5c3a 100644 --- a/usr/src/uts/common/sys/Makefile +++ b/usr/src/uts/common/sys/Makefile @@ -459,6 +459,7 @@ CHKHDRS= \ sockio.h \ squeue.h \ squeue_impl.h \ + srn.h \ sservice.h \ stat.h \ statfs.h \ diff --git a/usr/src/uts/common/sys/asy.h b/usr/src/uts/common/sys/asy.h index 491a222cd0..3b3d0c2a63 100644 --- a/usr/src/uts/common/sys/asy.h +++ b/usr/src/uts/common/sys/asy.h @@ -275,6 +275,15 @@ struct asycom { ddi_iblock_cookie_t asy_iblock; kmutex_t asy_excl; /* asy adaptive mutex */ kmutex_t asy_excl_hi; /* asy spinlock mutex */ + + /* + * The asy_soft_sr mutex should only be taken by the soft interrupt + * handler and the driver DDI_SUSPEND/DDI_RESUME code. It + * shouldn't be taken by any code that may get called indirectly + * by the soft interrupt handler (e.g. as a result of a put or + * putnext call). + */ + kmutex_t asy_soft_sr; /* soft int suspend/resume mutex */ uchar_t asy_msr; /* saved modem status */ uchar_t asy_mcr; /* soft carrier bits */ uchar_t asy_lcr; /* console lcr bits */ @@ -300,11 +309,13 @@ struct asycom { struct asyncline { int async_flags; /* random flags */ kcondvar_t async_flags_cv; /* condition variable for flags */ + kcondvar_t async_ops_cv; /* condition variable for async_ops */ dev_t async_dev; /* device major/minor numbers */ mblk_t *async_xmitblk; /* transmit: active msg block */ struct asycom *async_common; /* device common data */ tty_common_t async_ttycommon; /* tty driver common data */ bufcall_id_t async_wbufcid; /* id for pending write-side bufcall */ + size_t async_wbufcds; /* Buffer size requested in bufcall */ timeout_id_t async_polltid; /* softint poll timeout id */ timeout_id_t async_dtrtid; /* delaying DTR turn on */ timeout_id_t async_utbrktid; /* hold minimum untimed break time id */ @@ -343,6 +354,10 @@ struct asyncline { short async_ext; /* modem status change count */ short async_work; /* work to do flag */ timeout_id_t async_timer; /* close drain progress timer */ + + mblk_t *async_suspqf; /* front of suspend queue */ + mblk_t *async_suspqb; /* back of suspend queue */ + int async_ops; /* active operations counter */ }; /* definitions for async_flags field */ @@ -372,6 +387,8 @@ struct asyncline { #define ASYNC_OUT_FLW_RESUME 0x00100000 /* output need to be resumed */ /* because of transition of flow */ /* control from stop to start */ +#define ASYNC_DDI_SUSPENDED 0x00200000 /* suspended by DDI */ +#define ASYNC_RESUME_BUFCALL 0x00400000 /* call bufcall when resumed by DDI */ /* asy_hwtype definitions */ #define ASY8250A 0x2 /* 8250A or 16450 */ @@ -389,6 +406,7 @@ struct asyncline { #define ASY_RTS_DTR_OFF 0x00000020 #define ASY_IGNORE_CD 0x00000040 #define ASY_CONSOLE 0x00000080 +#define ASY_DDI_SUSPENDED 0x00000100 /* suspended by DDI */ /* definitions for asy_flags2 field */ #define ASY2_NO_LOOPBACK 0x00000001 /* Device doesn't support loopback */ diff --git a/usr/src/uts/common/sys/audio/impl/audio810_impl.h b/usr/src/uts/common/sys/audio/impl/audio810_impl.h index 7846685221..05baf89564 100644 --- a/usr/src/uts/common/sys/audio/impl/audio810_impl.h +++ b/usr/src/uts/common/sys/audio/impl/audio810_impl.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -64,6 +64,9 @@ extern "C" { #define I810_BSIZE (8*1024) +#define I810_NOT_SUSPENDED (0) +#define I810_SUSPENDED (~I810_NOT_SUSPENDED) + #define I810_MAX_CHANNELS (200) /* force max # chs */ #define I810_MAX_HW_CHANNELS (32) #define I810_MAX_IN_CHANNELS (1) @@ -279,6 +282,9 @@ struct audio810_state { int i810_psamples; /* pcm-out samples/intr */ uint32_t i810_res_flags; /* resource flags */ + int i810_suspended; /* suspend/resume state */ + int i810_busy_cnt; /* device busy count */ + kcondvar_t i810_cv; /* suspend/resume cond. var */ }; typedef struct audio810_state audio810_state_t; diff --git a/usr/src/uts/common/sys/cpr.h b/usr/src/uts/common/sys/cpr.h index 337cbf9986..6fd5438cc0 100644 --- a/usr/src/uts/common/sys/cpr.h +++ b/usr/src/uts/common/sys/cpr.h @@ -178,6 +178,9 @@ struct cprconfig { extern int cpr_debug; +#define errp prom_printf +#define DPRINT + /* * CPR_DEBUG1 displays the main flow of CPR. Use it to identify which * sub-module of CPR causes problems. @@ -393,6 +396,7 @@ typedef struct cpr_terminator ctrm_t; #define AD_CPR_TESTZ 8 /* test mode, auto-restart compress */ #define AD_CPR_PRINT 9 /* print out stats */ #define AD_CPR_NOCOMPRESS 10 /* store state file uncompressed */ +#define AD_CPR_SUSP_DEVICES 11 /* Only suspend resume devices */ #define AD_CPR_DEBUG0 100 /* clear debug flag */ #define AD_CPR_DEBUG1 101 /* display CPR main flow via prom */ #define AD_CPR_DEBUG2 102 /* misc small/mid size loops */ @@ -404,6 +408,31 @@ typedef struct cpr_terminator ctrm_t; #define AD_CPR_DEBUG9 109 /* display stat data on console */ /* + * Suspend to RAM test points. + * Probably belong above, but are placed here for now. + */ +/* S3 leave hardware on and return success */ +#define AD_LOOPBACK_SUSPEND_TO_RAM_PASS 22 + +/* S3 leave hardware on and return failure */ +#define AD_LOOPBACK_SUSPEND_TO_RAM_FAIL 23 + +/* S3 ignored devices that fail to suspend */ +#define AD_FORCE_SUSPEND_TO_RAM 24 + +/* S3 on a specified device */ +#define AD_DEVICE_SUSPEND_TO_RAM 25 + + + +/* + * Temporary definition of the Suspend to RAM development subcommands + * so that non-ON apps will work after initial integration. + */ +#define DEV_SUSPEND_TO_RAM 200 +#define DEV_CHECK_SUSPEND_TO_RAM 201 + +/* * cprboot related information and definitions. * The statefile names are hardcoded for now. */ @@ -506,6 +535,8 @@ extern cpr_t cpr_state; #define C_ST_SETPROPS_0 10 #define C_ST_DUMP_NOSPC 11 #define C_ST_REUSABLE 12 +#define C_ST_NODUMP 13 +#define C_ST_MP_PAUSED 14 #define cpr_set_substate(a) (CPR->c_substate = (a)) @@ -547,18 +578,25 @@ struct cpr_walkinfo { */ #define DCF_CPR_SUSPENDED 0x1 /* device went through cpr_suspend */ +/* + * Values used to differentiate between suspend to disk and suspend to ram + * in cpr_suspend and cpr_resume + */ + +#define CPR_TORAM 3 +#define CPR_TODISK 4 + #ifndef _ASM extern char *cpr_build_statefile_path(void); extern char *cpr_enumerate_promprops(char **, size_t *); extern char *cpr_get_statefile_prom_path(void); -extern int cpr_clrbit(pfn_t, int); extern int cpr_contig_pages(vnode_t *, int); extern int cpr_default_setup(int); extern int cpr_dump(vnode_t *); extern int cpr_get_reusable_mode(void); extern int cpr_isset(pfn_t, int); -extern int cpr_main(void); +extern int cpr_main(int); extern int cpr_mp_offline(void); extern int cpr_mp_online(void); extern int cpr_nobit(pfn_t, int); @@ -570,10 +608,10 @@ extern int cpr_read_phys_page(int, uint_t, int *); extern int cpr_read_terminator(int, ctrm_t *, caddr_t); extern int cpr_resume_devices(dev_info_t *, int); extern int cpr_set_properties(int); -extern int cpr_setbit(pfn_t, int); extern int cpr_statefile_is_spec(void); extern int cpr_statefile_offset(void); extern int cpr_stop_kernel_threads(void); +extern int cpr_threads_are_stopped(void); extern int cpr_stop_user_threads(void); extern int cpr_suspend_devices(dev_info_t *); extern int cpr_validate_definfo(int); @@ -585,9 +623,7 @@ extern int i_cpr_dump_sensitive_kpages(vnode_t *); extern int i_cpr_save_sensitive_kpages(void); extern pgcnt_t cpr_count_kpages(int, bitfunc_t); extern pgcnt_t cpr_count_pages(caddr_t, size_t, int, bitfunc_t, int); -extern pgcnt_t cpr_count_seg_pages(int, bitfunc_t); extern pgcnt_t cpr_count_volatile_pages(int, bitfunc_t); -extern pgcnt_t cpr_scan_kvseg(int, bitfunc_t, struct seg *); extern pgcnt_t i_cpr_count_sensitive_kpages(int, bitfunc_t); extern pgcnt_t i_cpr_count_special_kpages(int, bitfunc_t); extern pgcnt_t i_cpr_count_storage_pages(int, bitfunc_t); @@ -607,6 +643,9 @@ extern void cpr_stat_record_events(void); extern void cpr_tod_get(cpr_time_t *ctp); extern void cpr_tod_fault_reset(void); extern void i_cpr_bitmap_cleanup(void); +extern void i_cpr_stop_other_cpus(void); +extern void i_cpr_alloc_cpus(void); +extern void i_cpr_free_cpus(void); /*PRINTFLIKE2*/ extern void cpr_err(int, const char *, ...) __KPRINTFLIKE(2); diff --git a/usr/src/uts/common/sys/cpuvar.h b/usr/src/uts/common/sys/cpuvar.h index 3093034ceb..4785796781 100644 --- a/usr/src/uts/common/sys/cpuvar.h +++ b/usr/src/uts/common/sys/cpuvar.h @@ -512,6 +512,7 @@ extern cpuset_t cpu_seqid_inuse; #define CPU_CPR_OFFLINE 0x0 #define CPU_CPR_ONLINE 0x1 #define CPU_CPR_IS_OFFLINE(cpu) (((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE) == 0) +#define CPU_CPR_IS_ONLINE(cpu) ((cpu)->cpu_cpr_flags & CPU_CPR_ONLINE) #define CPU_SET_CPR_FLAGS(cpu, flag) ((cpu)->cpu_cpr_flags |= flag) #if defined(_KERNEL) || defined(_KMEMUSER) diff --git a/usr/src/uts/common/sys/dktp/cmdk.h b/usr/src/uts/common/sys/dktp/cmdk.h index 05dff32d9a..11b1bd9d78 100644 --- a/usr/src/uts/common/sys/dktp/cmdk.h +++ b/usr/src/uts/common/sys/dktp/cmdk.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -73,10 +73,26 @@ struct cmdk { uint32_t dk_altused; /* num entries in V_ALTSCTR */ uint32_t *dk_slc_cnt; /* entries per slice */ struct alts_ent **dk_slc_ent; /* link to remap data */ + + /* + * for power management + */ + kmutex_t dk_pm_mutex; + kcondvar_t dk_suspend_cv; + uint32_t dk_pm_level; + uint32_t dk_pm_is_enabled; }; +/* + * Power Management definitions + */ +#define CMDK_SPINDLE_UNINIT ((uint_t)(-1)) +#define CMDK_SPINDLE_OFF 0x0 +#define CMDK_SPINDLE_ON 0x1 + /* common disk flags definitions */ #define CMDK_OPEN 0x1 +#define CMDK_SUSPEND 0x2 #define CMDK_TGDK_OPEN 0x4 #define CMDKUNIT(dev) (getminor((dev)) >> CMDK_UNITSHF) diff --git a/usr/src/uts/common/sys/dktp/dadk.h b/usr/src/uts/common/sys/dktp/dadk.h index 0f07c5a89f..f5c990e7c0 100644 --- a/usr/src/uts/common/sys/dktp/dadk.h +++ b/usr/src/uts/common/sys/dktp/dadk.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -63,6 +63,8 @@ struct dadk { uchar_t dad_thread_cnt; /* reference count on removable */ /* - disk state watcher thread */ kstat_t *dad_errstats; /* error stats */ + kmutex_t dad_cmd_mutex; + int dad_cmd_count; }; #define DAD_SECSIZ dad_phyg.g_secsiz @@ -132,6 +134,8 @@ static void dadk_watch_thread(struct dadk *dadkp); int dadk_inquiry(opaque_t objp, opaque_t *inqpp); void dadk_cleanup(struct tgdk_obj *dkobjp); +int dadk_getcmds(opaque_t objp); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/sys/epm.h b/usr/src/uts/common/sys/epm.h index 5443eee3e2..35b656409b 100644 --- a/usr/src/uts/common/sys/epm.h +++ b/usr/src/uts/common/sys/epm.h @@ -34,6 +34,12 @@ #include <sys/ddi_impldefs.h> #include <sys/taskq.h> +/* + * XXXX + * Do we really need this include? It may be leftover from early CPUPM code. + * #include <sys/processor.h> + */ + #ifdef __cplusplus extern "C" { #endif @@ -225,6 +231,8 @@ typedef enum pm_cpupm PM_CPUPM_DISABLE /* do not power manage CPU devices */ } pm_cpupm_t; +#define PPM(dip) ((dev_info_t *)DEVI(dip)->devi_pm_ppm) + /* * The power request struct uses for the DDI_CTLOPS_POWER busctl. * @@ -258,7 +266,10 @@ typedef enum { PMR_PPM_TRY_LOCK_POWER, /* ppm try lock power */ PMR_PPM_INIT_CHILD, /* ppm init child notify */ PMR_PPM_UNINIT_CHILD, /* ppm uninit child notify */ - PMR_PPM_POWER_LOCK_OWNER /* ppm power lock owner's address */ + PMR_PPM_POWER_LOCK_OWNER, /* ppm power lock owner's address */ + PMR_PPM_ENTER_SX, /* ppm: enter ACPI S[2-4] state */ + PMR_PPM_EXIT_SX, /* ppm: enter ACPI S[2-4] state */ + PMR_PPM_SEARCH_LIST /* ppm: search tuple list */ } pm_request_type; /* @@ -386,9 +397,47 @@ typedef struct power_req { dev_info_t *who; kthread_t *owner; } ppm_power_lock_owner_req; + /* + * PMR_PPM_POWER_ENTER_SX + */ + struct ppm_power_enter_sx_req { + int sx_state; /* S3, S4 */ + int test_point; /* test point */ + uint64_t wakephys; /* restart vector phys addr */ + void *psr; /* PSM (apic) state buffer */ + } ppm_power_enter_sx_req; + /* + * PMR_PPM_SEARCH_LIST + */ + struct ppm_search_list { + pm_searchargs_t *searchlist; + int result; + } ppm_search_list_req; } req; } power_req_t; +#define S3 3 +#define S4 4 + +extern int cpr_test_point; +extern major_t cpr_device; + +#define LOOP_BACK_NONE 0 +#define LOOP_BACK_PASS 1 +#define LOOP_BACK_FAIL 2 +#define FORCE_SUSPEND_TO_RAM 3 +#define DEVICE_SUSPEND_TO_RAM 4 + +/* + * Struct passed as arg to appm_ioctl + */ +typedef struct s3_args { + int s3a_state; /* S3, S4 */ + int s3a_test_point; /* test point */ + uint64_t s3a_wakephys; /* restart vector physical addr */ + void *s3a_psr; /* apic state save buffer */ +} s3a_t; + /* * Structure used by the following bus_power operations: * @@ -624,25 +673,86 @@ typedef struct pm_thresh_rec { #define PMD_PIL 0x20000000 /* print out PIL when calling power */ #define PMD_PHC 0x40000000 /* pm_power_has_changed messages */ #define PMD_LOCK 0x80000000 +#define PMD_SX 0x80000000 /* ACPI S[1234] states */ +#define PMD_PROTO PMD_SX /* and other Prototype stuff */ extern uint_t pm_debug; extern uint_t pm_divertdebug; /*PRINTFLIKE1*/ extern void pm_log(const char *fmt, ...) __KPRINTFLIKE(1); +#if !defined(__sparc) +/* + * On non-sparc machines, PMDDEBUG isn't as big a deal as Sparc, so we + * define PMDDEUG here for use on non-sparc platforms. + */ +#define PMDDEBUG +#endif /* !__sparc */ + #ifdef PMDDEBUG #define PMD(level, arglist) { \ if (pm_debug & (level)) { \ pm_log arglist; \ } \ } -#else +#else /* !PMDDEBUG */ #define PMD(level, arglist) ((void)0); +#endif /* PMDDEBUG */ +#ifndef sparc +extern clock_t pt_sleep; +/* code is char hex number to display on POST LED */ +#define PT(code) {outb(0x80, (char)code); drv_usecwait(pt_sleep); } +#else +#define PT(code) #endif - #else #define PMD(level, arglist) +#define PT(code) #endif +/* + * Code Value Indication + * + */ +#define PT_SPL7 0x01 /* pm_suspend spl7 */ +#define PT_PMSRET 0x02 /* pm_suspend returns */ +#define PT_PPMCTLOP 0x03 /* invoking ppm_ctlops */ +#define PT_ACPISDEV 0x04 /* acpi suspend devices */ +#define PT_IC 0x05 /* acpi intr_clear */ +#define PT_1to1 0x06 /* 1:1 mapping */ +#define PT_SC 0x07 /* save context */ +#define PT_SWV 0x08 /* set waking vector */ +#define PT_SWV_FAIL 0x09 /* set waking vector failed */ +#define PT_EWE 0x0a /* enable wake events */ +#define PT_EWE_FAIL 0x0b /* enable wake events failed */ +#define PT_RTCW 0x0c /* setting rtc wakeup */ +#define PT_RTCW_FAIL 0x0d /* setting rtc wakeup failed */ +#define PT_TOD 0x0e /* setting tod */ +#define PT_SXP 0x0f /* sx prep */ +#define PT_SXE 0x10 /* sx enter */ +#define PT_SXE_FAIL 0x11 /* sx enter failed */ +#define PT_INSOM 0x12 /* insomnia label */ +#define PT_WOKE 0x20 /* woke up */ +#define PT_UNDO1to1 0x21 /* Undo 1:1 mapping */ +#define PT_LSS 0x22 /* leave sleep state */ +#define PT_LSS_FAIL 0x23 /* leave sleep state failed */ +#define PT_DPB 0x24 /* disable power button */ +#define PT_DPB_FAIL 0x25 /* disable power button failed */ +#define PT_DRTC_FAIL 0x26 /* disable rtc fails */ +#define PT_ACPIREINIT 0x27 /* reinit apic */ +#define PT_ACPIRESTORE 0x28 /* restore apic */ +#define PT_INTRRESTORE 0x28 /* restore interrupts */ +#define PT_RESDEV 0x2a /* ressume acpi devices */ +#define PT_CPU 0x2b /* init_cpu_syscall */ +#define PT_PRESUME 0x30 /* pm_resume entered */ +#define PT_RSUS 0x31 /* pm_resume "suspended" */ +#define PT_RKERN 0x32 /* pm_resume "kernel" */ +#define PT_RDRV 0x33 /* pm_resume "driver" */ +#define PT_RDRV_FAIL 0x34 /* pm_resume "driver" failed */ +#define PT_RRNOINVOL 0x35 /* pm_resume "reattach_noinvol" */ +#define PT_RUSER 0x36 /* pm_resume "user" */ +#define PT_RAPMSIG 0x37 /* pm_resume APM/SRN signal */ +#define PT_RMPO 0x38 /* pm_resume "mp_online" */ +#define PT_RDONE 0x39 /* pm_resume done */ extern void pm_detaching(dev_info_t *); extern void pm_detach_failed(dev_info_t *); @@ -721,7 +831,7 @@ extern int pm_is_cfb(dev_info_t *); extern int pm_cfb_is_up(void); #endif -#ifdef DEBUG +#ifdef DIPLOCKDEBUG #define PM_LOCK_DIP(dip) { PMD(PMD_LOCK, ("dip lock %s@%s(%s#%d) " \ "%s %d\n", PM_DEVICE(dip), \ __FILE__, __LINE__)) \ diff --git a/usr/src/uts/common/sys/pm.h b/usr/src/uts/common/sys/pm.h index a65075b3a5..8be171fef1 100644 --- a/usr/src/uts/common/sys/pm.h +++ b/usr/src/uts/common/sys/pm.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -95,7 +95,16 @@ typedef enum { PM_STOP_CPUPM, PM_GET_CPU_THRESHOLD, PM_SET_CPU_THRESHOLD, - PM_GET_CPUPM_STATE + PM_GET_CPUPM_STATE, + PM_ENABLE_S3, /* allow pm to go to S3 state */ + PM_DISABLE_S3, /* do not allow pm to go to S3 state */ + PM_ENTER_S3, /* obsolete, not supported */ + PM_START_AUTOS3, + PM_STOP_AUTOS3, + PM_SEARCH_LIST, /* search S3 enable/disable list */ + PM_GET_AUTOS3_STATE, + PM_GET_S3_SUPPORT_STATE, + PM_GET_CMD_NAME } pm_cmds; /* @@ -129,6 +138,17 @@ typedef struct pm_req { } pm_req_t; /* + * PM_SEARCH_LIST requires a list name, manufacturer and product name + * Searches the named list for a matching tuple. + * NOTE: This structure may be removed in a later release. + */ +typedef struct pm_searchargs { + char *pms_listname; /* name of list to search */ + char *pms_manufacturer; /* 1st elment of tuple */ + char *pms_product; /* 2nd elment of tuple */ +} pm_searchargs_t; + +/* * Use these for PM_ADD_DEPENDENT and PM_ADD_DEPENDENT_PROPERTY */ #define pmreq_keeper physpath /* keeper in the physpath field */ @@ -208,6 +228,13 @@ typedef struct pm_state_change32 { size32_t size; /* size of buffer physpath points to */ } pm_state_change32_t; +typedef struct pm_searchargs32_t { + caddr32_t pms_listname; + caddr32_t pms_manufacturer; + caddr32_t pms_product; +} pm_searchargs32_t; + + #endif /* @@ -228,10 +255,13 @@ typedef enum { PM_CPU_THRESHOLD, PM_CPU_PM_ENABLED, PM_CPU_PM_DISABLED, - PM_CPU_PM_NOTSET + PM_CPU_PM_NOTSET, + PM_AUTOS3_ENABLED, + PM_AUTOS3_DISABLED, + PM_S3_SUPPORT_ENABLED, + PM_S3_SUPPORT_DISABLED } pm_states; - #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/sys/ppmvar.h b/usr/src/uts/common/sys/ppmvar.h index 87d2a68086..1b8562a423 100644 --- a/usr/src/uts/common/sys/ppmvar.h +++ b/usr/src/uts/common/sys/ppmvar.h @@ -135,6 +135,12 @@ struct ppm_dc { ldi_handle_t lh; /* layered (ldi) handle */ char *path; /* control device prom pathname */ uint_t cmd; /* search key: op to be performed */ + /* one of: PPMDC_CPU_NEXT */ + /* PPMDC_CPU_GO, PPMDC_FET_ON, */ + /* PPMDC_FET_OFF, PPMDC_LED_ON, */ + /* PPMDC_LED_OFF, PPMDC_PCI_ON, */ + /* PPMDC_ENTER_S3, PPMDC_PCI_OFF */ + /* PPMDC_EXIT_S3 commands */ uint_t method; /* control method / union selector */ /* one of PPMDC_KIO, PPMDC_I2CKIO, */ /* PPMDC_CPUSPEEDKIO */ @@ -157,6 +163,7 @@ struct ppm_dc { uint_t post_delay; /* post delay, if any */ } kio; +#ifdef sun4u /* PPMDC_I2CKIO: KIO requires 'arg' as struct i2c_gpio */ /* (defined in i2c_client.h) */ struct m_i2ckio { @@ -169,6 +176,7 @@ struct ppm_dc { /* operation can be carried out */ uint_t post_delay; /* post delay, if any */ } i2c; +#endif /* PPMDC_CPUSPEEDKIO, PPMDC_VCORE: cpu estar related */ /* simple KIO */ @@ -203,6 +211,8 @@ typedef struct ppm_dc ppm_dc_t; #define PPMDC_PWR_ON 16 #define PPMDC_RESET_OFF 17 #define PPMDC_RESET_ON 18 +#define PPMDC_ENTER_S3 19 +#define PPMDC_EXIT_S3 20 /* * ppm_dc.method field - select union element @@ -210,7 +220,9 @@ typedef struct ppm_dc ppm_dc_t; #define PPMDC_KIO 1 /* simple ioctl with val as arg */ #define PPMDC_CPUSPEEDKIO 2 /* ioctl with speed index arg */ #define PPMDC_VCORE 3 /* CPU Vcore change operation */ +#ifdef sun4u #define PPMDC_I2CKIO 4 /* ioctl with i2c_gpio_t as arg */ +#endif /* * devices that are powered by the same source @@ -245,6 +257,7 @@ typedef struct ppm_domain ppm_domain_t; #define PPMD_PCI 4 /* PCI pm model */ #define PPMD_PCI_PROP 5 /* PCI_PROP pm model */ #define PPMD_PCIE 6 /* PCI Express pm model */ +#define PPMD_SX 7 /* ACPI Sx pm model */ #define PPMD_IS_PCI(model) \ ((model) == PPMD_PCI || (model) == PPMD_PCI_PROP) diff --git a/usr/src/uts/common/sys/rtc.h b/usr/src/uts/common/sys/rtc.h index 330f41ee69..1db2925542 100644 --- a/usr/src/uts/common/sys/rtc.h +++ b/usr/src/uts/common/sys/rtc.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,9 @@ * * CDDL HEADER END */ + /* - * Copyright 1999 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -90,7 +90,7 @@ extern "C" { #define RTC_VRT 0x80 /* Valid RAM and time bit */ #define RTC_NREG 0x0e /* number of RTC registers */ -#define RTC_NREGP 0x0a /* number of RTC registers to set time */ +#define RTC_NREGP 0x0c /* number of RTC registers to set time */ #define RTC_CENTURY 0x32 /* not included in RTC_NREG(P) */ /* @@ -117,6 +117,8 @@ struct rtc_t { /* registers 0x0 to 0xD, 0x32 */ unsigned char rtc_statusc; unsigned char rtc_statusd; unsigned char rtc_century; /* register 0x32 */ + unsigned char rtc_adom; /* ACPI-provided day alarm */ + unsigned char rtc_amon; /* ACPI-provided mon alarm */ }; #ifdef __cplusplus diff --git a/usr/src/uts/common/sys/srn.h b/usr/src/uts/common/sys/srn.h new file mode 100644 index 0000000000..6145a98108 --- /dev/null +++ b/usr/src/uts/common/sys/srn.h @@ -0,0 +1,79 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_SRN_H +#define _SYS_SRN_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * The following ioctl commands and structures may not exist + * or may have a different interpretation in a future release. + */ + + +#define SRN_STANDBY_REQ 0xa01 +#define SRN_SUSPEND_REQ 0xa02 +#define SRN_NORMAL_RESUME 0xa03 +#define SRN_CRIT_RESUME 0xa04 +#define SRN_BATTERY_LOW 0xa05 +#define SRN_POWER_CHANGE 0xa06 +#define SRN_UPDATE_TIME 0xa07 +#define SRN_CRIT_SUSPEND_REQ 0xa08 +#define SRN_USER_STANDBY_REQ 0xa09 +#define SRN_USER_SUSPEND_REQ 0xa0a +#define SRN_SYS_STANDBY_RESUME 0xa0b +#define SRN_IOC_NEXTEVENT 0xa0c +#define SRN_IOC_RESUME 0xa0d +#define SRN_IOC_SUSPEND 0xa0e +#define SRN_IOC_STANDBY 0xa0f +#define SRN_IOC_AUTOSX 0xa10 /* change behavior of driver */ + +typedef struct srn_event_info +{ + int ae_type; + +} srn_event_info_t; + +#ifdef _KERNEL + +#define SRN_MAX_CLONE 8 /* only two consumer known */ + +#define SRN_TYPE_APM 1 +#define SRN_TYPE_AUTOSX 2 + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_SRN_H */ diff --git a/usr/src/uts/common/sys/sunddi.h b/usr/src/uts/common/sys/sunddi.h index 351a75bcd4..82cb130bd9 100644 --- a/usr/src/uts/common/sys/sunddi.h +++ b/usr/src/uts/common/sys/sunddi.h @@ -1919,6 +1919,12 @@ pci_target_enqueue(uint64_t, char *, char *, uint64_t); void pci_targetq_init(void); +int +pci_post_suspend(dev_info_t *dip); + +int +pci_pre_resume(dev_info_t *dip); + /* * the prototype for the C Language Type Model inquiry. */ diff --git a/usr/src/uts/common/sys/uadmin.h b/usr/src/uts/common/sys/uadmin.h index d88f247a93..e307462896 100644 --- a/usr/src/uts/common/sys/uadmin.h +++ b/usr/src/uts/common/sys/uadmin.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -58,12 +58,27 @@ extern "C" { #define AD_POWEROFF 6 /* software poweroff */ #define AD_NOSYNC 7 /* do not sync filesystems on next A_DUMP */ + /* * Functions reserved for A_FREEZE (may not be available on all platforms) + * Note: AD_COMPRESS, AD_CHECK and AD_FORCE are now obsolete + * The first two are succeeded by AD_SUSPEND_TO_DISK and + * AD_CHECK_SUSPEND_TO_DISK respectively. + * AD_FORCE should not be used by any new application + * + * We maintain compatibility with the earlier interfaces: + * AD_COMPRESS and AD_CHECK, by preserving those values + * in the corresponding new interfaces */ + #define AD_COMPRESS 0 /* store state file compressed during CPR */ #define AD_FORCE 1 /* force to do AD_COMPRESS */ #define AD_CHECK 2 /* test if CPR module is available */ +#define AD_SUSPEND_TO_DISK AD_COMPRESS /* A_FREEZE, CPR or ACPI S4 */ +#define AD_CHECK_SUSPEND_TO_DISK AD_CHECK /* A_FREEZE, CPR/S4 capable? */ +#define AD_SUSPEND_TO_RAM 20 /* A_FREEZE, S3 */ +#define AD_CHECK_SUSPEND_TO_RAM 21 /* A_FREEZE, S3 capable? */ + /* * NOTE: the following defines comprise an Unstable interface. Their semantics * may change or they may be removed completely in a later release |