Overriding tables ... (was: Compaq 1720US, 2.4.18, acp i-7,24 - Help)
Grr.. exims playing up again! But just in case this does get double posted, there is a correction anyway...
The code snippet should obviously have ,sizeof(*new_table->signature) rather
than sizeof(new_table->signature). Pointers never were my strong poing.
READ ON!
Quoted 11 lines · Robert
The description of
acpi_tb_table_overrideis "Attempts override of current table with a new one if provided by the host OS" in the current ACPI release.
Tb_table_overridecallsOs_table_overridewhich in turn must examine the table header (esp. the signature) and decide whether to override or not.The recent issue seems to be that tbget now calls
tb_table_overridefor all tables, not just the DSDT. Therefore,os_table_overridemust now check the table signature.
I concur entirely, this was the point of the code snippet, a suggestion of how the checking could be achieved.
IMHO the problem could have been entirely avoided if the functions in osl.c were documented, both as to what they are intended to do and probably also a note where this is yet to be fully implimented. Had the desctiption of acpi_os_table_override been in osl.c where the function resided instead of tbget.c, it would have been clear that the function was designed to check the validity of the replacement table and nobody would have suggested patches to replace the DSDT go there.
I am happy to read through the code and try to document what has been implimented if required, but I think it would be better achieved by someone with a better understanding not only of what is implimented, but also the intended functionality.
If this documentation is done now, I think the advancement of the acpi code will be much hastened, since people like myself with a little bit of spare time over the holidays could contribute by reading over parts of the code to find bugs, rather than having to spend hours trying to get familiar with ever aspect of the acpi code, in order to understand what is/should be/might be supposed to me happening in each function.
This is, of course just my 2c worth and my intention is not at all to offend anyone who has contributed to what is now, for most people, fairly usable and stable code.
On a related subject, I think the 2 lines to do the checking in function os_table_override in osl.c should read:
if(strncmp(existing_table->signature,*new_table->signature,sizeof(*new_table->signature)-1)
*new_table = NULL ;
since the size of the signature presumably does not always have to be the size of XSDT_SIG as I had previously suggested.
Quoted 64 lines
-----Original Message-----
From: Huw Hawkins [mailto:hrhawk-JGs/[email protected]]
Sent: Tuesday, August 13, 2002 2:23 PM
To: [email protected]
Subject: [ACPI] Overriding tables ... (was: Compaq 1720US, 2.4.18, acpi-7,24
- Help)This was the point of my earlier post (Patching tables
osl.cdoesn't work as advertised ... ).As far as I can see, the propper place for putting patches to override
tables would be intbget.csince appears to be a function (acpi_tb_table_override) written with hooks for exactly this purpose.
___HOWEVER___
this function will not work, since the functionacpi_os_table_override(&old_table, &new_table)in fact is not written to do what the documentation intbget.csuggests. To make this happen I would suggest something along these lines.------------------------------------------------------------------------
/* ********************************************************************
*
* FUNCTION:acpi_os_table_override
*
* PARAMETERS:existing_table- Pointer to the existing table header
*new_table- pointer to pointer to new table header
*
* RETURN :AE_OK(or possibly at a later date error codes?)
*
* DESCRIPTION : will examine the header and decide whether to override
* a table with a new table. Returning either a pointer
* to the new table if it is a valid substitution or NULL
* otherwise
* ********************************************************************/
acpi_statusacpi_os_table_override(acpi_table_header*existing_table,acpi_table_header**new_table){ if (!existing_table || !new_table) return AE_BAD_PARAMETER;if(strncmp(existing_table->signature,*new_table->signature,sizeof(XSDT_SIG)-
1)*new_table = NULL ; return AE_OK; }-------------------------------------------------------------------------
On a related note, the whole of the
osl.cfile needs documentation, to
aid further efforts at development.
Quoted 9 lines
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Acpi-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/acpi-devel
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31