Patchwork [1/3,Seabios] Add bitmap for cpu _EJ0 callback

login
register
mail settings
Submitter Vasilis Liaskovitis
Date Jan. 13, 2012, 11:11 a.m.
Message ID <1326453092-4256-2-git-send-email-vasilis.liaskovitis@profitbricks.com>
Download mbox | patch
Permalink /patch/135834/
State New
Headers show

Comments

Vasilis Liaskovitis - Jan. 13, 2012, 11:11 a.m.
Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
---
 src/acpi-dsdt.dsl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
Kevin O'Connor - Jan. 14, 2012, 12:27 a.m.
On Fri, Jan 13, 2012 at 12:11:30PM +0100, Vasilis Liaskovitis wrote:
> 
> Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>

The SeaBIOS change is okay with me, but the qemu/kvm change needs to
be accepted first.

[...]
>          Method (CPEJ, 2, NotSerialized) {
>              // _EJ0 method - eject callback
> +            Store(ShiftLeft(1, Arg0), PRE)
>              Sleep(200)
>          }

Is the Sleep() still needed?

-Kevin
Vasilis Liaskovitis - Jan. 16, 2012, 11:33 a.m.
On Fri, Jan 13, 2012 at 07:27:01PM -0500, Kevin O'Connor wrote:
> On Fri, Jan 13, 2012 at 12:11:30PM +0100, Vasilis Liaskovitis wrote:
> > 
> > Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
> 
> The SeaBIOS change is okay with me, but the qemu/kvm change needs to
> be accepted first.
> 
> [...]
> >          Method (CPEJ, 2, NotSerialized) {
> >              // _EJ0 method - eject callback
> > +            Store(ShiftLeft(1, Arg0), PRE)
> >              Sleep(200)
> >          }
> 
> Is the Sleep() still needed?

I believe it's unneccesary. I 'll test without it and resend.
thanks,

- Vasilis
Vasilis Liaskovitis - Jan. 19, 2012, 2:02 p.m.
On Fri, Jan 13, 2012 at 07:27:01PM -0500, Kevin O'Connor wrote:
> 
> [...]
> >          Method (CPEJ, 2, NotSerialized) {
> >              // _EJ0 method - eject callback
> > +            Store(ShiftLeft(1, Arg0), PRE)
> >              Sleep(200)
> >          }
>
I have another question here: the PCI _EJO callback seems to return 0x0, but
the CPU _EJ0 doesn't return anything. THe ACPIspec4.0a draft section 6.3.3
mentions that _EJx methods have no return value. Is the above difference
intentional?

thanks,

- Vasilis
Kevin O'Connor - Jan. 20, 2012, 1:08 a.m.
On Thu, Jan 19, 2012 at 03:02:30PM +0100, Vasilis Liaskovitis wrote:
> On Fri, Jan 13, 2012 at 07:27:01PM -0500, Kevin O'Connor wrote:
> > 
> > [...]
> > >          Method (CPEJ, 2, NotSerialized) {
> > >              // _EJ0 method - eject callback
> > > +            Store(ShiftLeft(1, Arg0), PRE)
> > >              Sleep(200)
> > >          }
> >
> I have another question here: the PCI _EJO callback seems to return 0x0, but
> the CPU _EJ0 doesn't return anything. THe ACPIspec4.0a draft section 6.3.3
> mentions that _EJx methods have no return value. Is the above difference
> intentional?

If the spec says it doesn't return anything, but the acpi code is,
it's probably just an error.

-Kevin

Patch

diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 7082b65..71d8ac4 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -650,8 +650,15 @@  DefinitionBlock (
             Store(DerefOf(Index(CPON, Arg0)), Local0)
             If (Local0) { Return(0xF) } Else { Return(0x0) }
         }
+        /* CPU eject notify method */
+        OperationRegion(PREJ, SystemIO, 0xaf20, 32)
+        Field (PREJ, ByteAcc, NoLock, Preserve)
+        {
+            PRE, 256
+        }
         Method (CPEJ, 2, NotSerialized) {
             // _EJ0 method - eject callback
+            Store(ShiftLeft(1, Arg0), PRE)
             Sleep(200)
         }