Skip to contentSkip to conversation

Bitfield usage in FADT table?

DISCUSSION maxime bizon 4 participants 14 messages Nov 11, 2003 – Nov 12, 2003 10 messages not in the archive ACPI

lore
Share & tools
lore
#0 lore raw

Hello,

I'm using kernel 2.6.0-test9 on a i386 notebook.

I forced a new FADT table in the kernel and put the following bytes at offset 0x70: 0xf1 0xa2 0x35 0x78.

Then I made some printk at kernel init and here is the output:

begin dump of fadt:
[...]
6e 0
6f 0
70 f1
71 a2
72 35
73 78
74 0
75 0
[...]
bit wb_invd is 1
bit wb_invd_flush is 0
bit proc_c1 is 0
bit plvl2_up is 0
bit pwr_button is 1
bit sleep_button is 1
bit fixed_rTC is 1
bit rtcs4 is 1
bit tmr_val_ext is 0
bit dock_cap is 1
bit reset_reg_sup is 0
bit sealed_case is 0
bit headless is 0
bit cpu_sw_sleep is 1

gcc-2.95 and gcc-3.3 give the same thing.

Is it really what it is supposed to be?

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 36 lines · maxime bizon

Hello,

I'm using kernel 2.6.0-test9 on a i386 notebook.

I forced a new FADT table in the kernel and put the following bytes at offset 0x70: 0xf1 0xa2 0x35 0x78.

Then I made some printk at kernel init and here is the output:

begin dump of fadt:
[...]
6e 0
6f 0
70 f1
71 a2
72 35
73 78
74 0
75 0
[...]
bit wb_invd is 1
bit wb_invd_flush is 0
bit proc_c1 is 0
bit plvl2_up is 0
bit pwr_button is 1
bit sleep_button is 1
bit fixed_rTC is 1
bit rtcs4 is 1
bit tmr_val_ext is 0
bit dock_cap is 1
bit reset_reg_sup is 0
bit sealed_case is 0
bit headless is 0
bit cpu_sw_sleep is 1

Quoted 4 lines

gcc-2.95 and gcc-3.3 give the same thing.

Is it really what it is supposed to be?

To be what? What you want to do, exactly?

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 27 lines · Ducrot Bruno
Quoted 26 lines

begin dump of fadt:
[...]
6e 0
6f 0
70 f1
71 a2
72 35
73 78
74 0
75 0
[...]
bit wb_invd is 1
bit wb_invd_flush is 0
bit proc_c1 is 0
bit plvl2_up is 0
bit pwr_button is 1
bit sleep_button is 1
bit fixed_rTC is 1
bit rtcs4 is 1
bit tmr_val_ext is 0
bit dock_cap is 1
bit reset_reg_sup is 0
bit sealed_case is 0
bit headless is 0
bit cpu_sw_sleep is 1

Quoted 3 lines
Quoted 1 line

Is it really what it is supposed to be?

To be what?

According to the ACPI specs:

value bit offset
===== ==========
wb_invd 0
wb_invd_flush 1
proc_c1 2
plvl2_up 3
pwr_button 4
sleep_button 5
[...]

So, for instance, sleep_button should be 0, no ?

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 46 lines · maximE bizon
Quoted 27 lines · Ducrot Bruno
Quoted 26 lines

begin dump of fadt:
[...]
6e 0
6f 0
70 f1
71 a2
72 35
73 78
74 0
75 0
[...]
bit wb_invd is 1
bit wb_invd_flush is 0
bit proc_c1 is 0
bit plvl2_up is 0
bit pwr_button is 1
bit sleep_button is 1
bit fixed_rTC is 1
bit rtcs4 is 1
bit tmr_val_ext is 0
bit dock_cap is 1
bit reset_reg_sup is 0
bit sealed_case is 0
bit headless is 0
bit cpu_sw_sleep is 1

Quoted 3 lines
Quoted 1 line

Is it really what it is supposed to be?

To be what?

According to the ACPI specs:

value bit offset
===== ==========
wb_invd 0
wb_invd_flush 1
proc_c1 2
plvl2_up 3
pwr_button 4
sleep_button 5
[...]

Quoted 1 line

So, for instance, sleep_button should be 0, no ?

No. This is a double word, so, with endianess issues, you actually have overwriten with
0x7825a2f1

and bit 5 of 0x7825a2f1 is 1.

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
#7 lore raw
In reply to a message not in the archive
Quoted 14 lines · maximE bizon
Quoted 11 lines · Ducrot Bruno
Quoted 11 lines

begin dump of fadt:
[...]
6e 0
6f 0
70 f1
71 a2
72 35
73 78
74 0
75 0
[...]

You also forgot to answer to my second question:

What you want to do, exactly?

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 3 lines · Ducrot Bruno

You also forgot to answer to my second question:

What you want to do, exactly?

I own a Latitude X200 notebook, with kernel 2.6.0-test9 installed, and S3 doesn't work. It was posted here a few days ago. S3 does suspend the computer but it is impossible to turn it on again.

I noticed that my power button is detected as a FF because FADT pwr_button flag is not set, though the DSDT defines one.

I suspected the S3 problem to come from this, so I tried to correct my FADT, but I forgot that the bitfield was on u32...

Now with the correct fix, I can see an acpi event when I press the power button, but the system still won't come up after an S3.

Any idea ?

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw
Quoted 10 lines · maximE bizon
Quoted 3 lines · Ducrot Bruno

You also forgot to answer to my second question:

What you want to do, exactly?

I own a Latitude X200 notebook, with kernel 2.6.0-test9 installed, and S3 doesn't work. It was posted here a few days ago. S3 does suspend the computer but it is impossible to turn it on again.

S3 seems to be broken in that kernel, anyway.

Quoted 5 lines

I noticed that my power button is detected as a FF because FADT pwr_button flag is not set, though the DSDT defines one.

I suspected the S3 problem to come from this, so I tried to correct my FADT, but I forgot that the bitfield was on u32...

Why not just hacking the source, instead of overwritten the FADT, for only one flag?

Quoted 6 lines

Now with the correct fix, I can see an acpi event when I press the power button, but the system still won't come up after an S3.

Any idea ?

perhaps you can try a latest mm serie?

Cheers,

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 1 line · Ducrot Bruno

S3 seems to be broken in that kernel, anyway.

I tried every release since 2.5.70.

Quoted 2 lines

Why not just hacking the source, instead of overwritten the FADT, for only one flag?

Had it worked, it would have been more convenient to provide a patched FADT to other X200 users.

Quoted 1 line

perhaps you can try a latest mm serie?

I just tried, that doesn't change anything.

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#15 lore raw
Quoted 7 lines · maxime bizon
Quoted 1 line · Ducrot Bruno

S3 seems to be broken in that kernel, anyway.

I tried every release since 2.5.70.

Ahem, I got success with 2.5.7x, or so.

I think also that I got success with 2.6.0-testX, but I don't remember when it broke (should be for X=5 IIRC) even without the 'faulty' drivers.

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw
Quoted 4 lines · Ducrot Bruno

Ahem, I got success with 2.5.7x, or so.

I think also that I got success with 2.6.0-testX, but I don't remember when it broke (should be for X=5 IIRC) even without the 'faulty' drivers.

Did it work for an X200 or for another laptop?

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#19 lore raw
Quoted 10 lines · maximE bizon
Quoted 4 lines · Ducrot Bruno

Ahem, I got success with 2.5.7x, or so.

I think also that I got success with 2.6.0-testX, but I don't remember when it broke (should be for X=5 IIRC) even without the 'faulty' drivers.

Did it work for an X200 or for another laptop?

For another laptop. Well, I supposed you had understood. Sorry for confusion.

Signature · 11 lines
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
#20 lore raw
In reply to a message not in the archive

Thus wrote Ducrot Bruno:

Quoted 4 lines
Quoted 3 lines

I own a Latitude X200 notebook, with kernel 2.6.0-test9 installed, and S3 doesn't work. It was posted here a few days ago. S3 does suspend the computer but it is impossible to turn it on again.

S3 seems to be broken in that kernel, anyway.

Strange, it worked fine on my system, keyboard and USB problems aside. Best regards,

Signature · 9 lines
Karol 'sziwan' Kozimor
sziwan-DETuoxkZsSqrDJvtcaxF/[email protected]


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
#21 lore raw
In reply to a message not in the archive

On Tue, 11 Nov 2003 17:15:28 +0100 maxime bizon <[email protected]> wrote:

| 
| Hello,
| 
| I'm using kernel 2.6.0-test9 on a i386 notebook.
| 
| I forced a new FADT table in the kernel and put the following bytes at
| offset 0x70:  0xf1 0xa2 0x35 0x78.
| 
| Then I made some printk at kernel init and here is the output:
| 
| begin dump of fadt:
| [...]
| 6e	0
| 6f	0
| 70	f1
| 71	a2
| 72	35
| 73	78
| 74	0
| 75	0
| [...]
| bit wb_invd is 1
| bit wb_invd_flush is 0
| bit proc_c1 is 0
| bit plvl2_up is 0
| bit pwr_button is 1
| bit sleep_button is 1
| bit fixed_rTC is 1
| bit rtcs4 is 1
| bit tmr_val_ext is 0
| bit dock_cap is 1
| bit reset_reg_sup is 0
| bit sealed_case is 0
| bit headless is 0
| bit cpu_sw_sleep is 1
| 
| gcc-2.95 and gcc-3.3 give the same thing.
| 
| Is it really what it is supposed to be?

It can be confusing, can't it?

Yes, I think that they are correct.
Look at the bit field as a u32: it's value is 0x7835a2f1.

Now look at the bit numbers in that u32 value and assign bit field names to them and it will match your list above.

--
~Randy
MOTD: Always include version info.

simple bitfields program output:

[[email protected] src]$ ./bitfields bits as u32 = 0x7835a2f1
bytes (hex): f1 a2 35 78
individual bits:

wb_invd:        1
wb_invd_flush:  0
proc_c1:        0
plvl2_up:       0
pwr_button:     1
sleep_button:   1
fixed_rTC:      1
rtcs4:          1
tmr_val_ext:    0
dock_cap:       1
reset_reg_sup:  0
sealed_case:    0
headless:       0
cpu_sw_sleep:   1
reserved6:    0x1e0d6

-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw
Quoted 7 lines · Randy.Dunlap

It can be confusing, can't it?

Yes, I think that they are correct.
Look at the bit field as a u32: it's value is 0x7835a2f1.

Now look at the bit numbers in that u32 value and assign bit field names to them and it will match your list above.

Yes, my mistake.

Thanks.

Signature · 8 lines
Maxime


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/