From owner-freebsd-current@FreeBSD.ORG Sun Oct 10 03:07:34 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1D4F16A4CE; Sun, 10 Oct 2004 03:07:33 +0000 (GMT) Received: from ylpvm43.prodigy.net (ylpvm43-ext.prodigy.net [207.115.57.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9538F43D48; Sun, 10 Oct 2004 03:07:33 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.52] (adsl-64-171-187-209.dsl.snfc21.pacbell.net [64.171.187.209])i9A37d9p004447; Sat, 9 Oct 2004 23:07:40 -0400 Message-ID: <4168A773.3020705@root.org> Date: Sat, 09 Oct 2004 20:07:31 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040901) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce M Simpson References: <5ad23a300410071928791fa9c@mail.gmail.com> <20041008030317.GV664@empiric.icir.org> <5ad23a3004100720467646e1ea@mail.gmail.com> <20041008102758.GH718@empiric.icir.org> <20041008223600.GL718@empiric.icir.org> In-Reply-To: <20041008223600.GL718@empiric.icir.org> Content-Type: multipart/mixed; boundary="------------020201060902030102030204" cc: anholt@freebsd.org cc: freebsd-current@freebsd.org cc: imp@freebsd.org cc: Jordan Sissel Subject: Re: Radeon AGP suspend/resume support X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2004 03:07:34 -0000 This is a multi-part message in MIME format. --------------020201060902030102030204 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 --------------020201060902030102030204 Content-Type: text/plain; name="x_apm.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x_apm.diff" --- 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 +#else #include +#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; --------------020201060902030102030204--