Radeon AGP suspend/resume support

Nate Lawson nate at root.org
Sat Oct 9 20:07:34 PDT 2004


Bruce M Simpson wrote:
> There are two problems with this:
>  1) This uses a NetBSD specific interface, which, whilst broadly similar
>     to FreeBSD's apm support, is not ABI compatible with ours.
>  2) The ACPI apm shim does not dispatch such events. They are only
>     dispatched within the system if 'real' BIOS APM support is in the
>     kernel.  This cannot co-exist with ACPI. Furthermore they are only
>     announced on the /dev/apmctl device; there are some comments in the
>     code to this effect.

Oops, forgot the attachment for FreeBSD compat defines.  Here it is 
(untested).

-Nate

-------------- next part --------------
--- bsd_apm.c.orig	Sat Oct  9 12:14:26 2004
+++ bsd_apm.c	Sat Oct  9 12:24:32 2004
@@ -8,12 +8,36 @@
 #include "xf86_OSproc.h"
 #include "xf86_OSlib.h"
 
+#ifdef __FreeBSD__
+#include <machine/apm_bios.h>
+#else
 #include <machine/apmvar.h>
+#endif
 
 #define APM_DEVICE "/dev/apm"
 
 static pointer APMihPtr = NULL;
 static void bsdCloseAPM(void);
+
+/* Compat defines for FreeBSD APM. */
+#ifdef __FreeBSD__
+#define APM_STANDBY_REQ		PMEV_STANDBYREQ
+#define APM_SUSPEND_REQ		PMEV_SUSPENDREQ
+#define APM_NORMAL_RESUME	PMEV_NORMALRESUME
+#define APM_CRIT_RESUME		PMEV_CRITRESUME
+#define APM_BATTERY_LOW		PMEV_BATTERYLOW
+#define APM_POWER_CHANGE	PMEV_POWERCHANGE
+#define APM_UPDATE_TIME		PMEV_UPDATETIME
+#define APM_CRIT_SUSPEND_REQ	PMEV_CRITSUSPENDREQ
+#define APM_USER_STANDBY_REQ	PMEV_USERSTANDBYREQ
+#define APM_USER_SUSPEND_REQ	PMEV_USERSUSPENDREQ
+#define APM_SYS_STANDBY_RESUME	PMEV_STANDBYRESUME
+#define APM_CAPABILITY_CHANGE	PMEV_CAPABILITIESCHANGE
+
+#define APM_IOC_NEXTEVENT	APMIO_NEXTEVENT
+#define APM_IOC_STANDBY		APMIO_STANDBY
+#define APM_IOC_SUSPEND		APMIO_SUSPEND
+#endif /* __FreeBSD__ */
 
 static struct {
     u_int apmBsd;


More information about the freebsd-current mailing list