reedwind / lib

0 stars 0 forks source link

Bug 399 - iASL: Additional errors to be reported for Control Method Declaration #119

Open reedwind opened 11 years ago

reedwind commented 11 years ago

Reported by: Valery Podrezov valery.a.podrezov@intel.com Reported at: 2006-05-24 21:14:17

Product: ACPICA Component: iASL Compiler Platform: All OS: Linux Priority: P3 Severity: normal

reedwind commented 11 years ago

Commented by: Valery Podrezov valery.a.podrezov@intel.com Commented at: 2006-05-24 21:14:17

1) The ASL Compiler should report an error when NumArgs argument in Control Method Declaration doesn't match the length of the ParameterTypes list.

................................... 17.5.75 Method (Declare Control Method) ... ParameterTypes is an optional package containing comma-separated type or types of each of the parameters. For each parameter type, there is either a single type keyword or a package containing a comma-separated lists of ObjectTypeKeyword. If specified, then the number of types must match NumArgs. ...................................

2) The ASL Compiler should report an error when some ObjectType Keyword different from UnknownObj is specified in the ReturnType position but no any actual Return operator is specified.

At least indirectly it could follow from this paragraph: ................................... 17.5.75 Method (Declare Control Method) ... ReturnType is optional and specifies the type of the object returned by the method. If the method does not return an object, then nothing is specified or UnknownObj is specified. To specify a single return type, simply use the ObjectTypeKeyword (e.g. IntObj, PackageObj, etc.). To specify multiple possible return types, enclose the comma-separated ObjectTypeKeywords with curly brackets. For example: {IntObj, BufferObj}. ...................................

3) Moreover the Compiler could report warnings (or errors) when there are the following conditions in the ReturnType (or ParameterType) list:

................................... Code of demo: // Some different from UnknownObj ObjectType Keyword specified in the // ReturnType position but no any actual Object specified to be returned. Method(mm1b, , , , IntObj) {Store(1, Debug)}

// The same specific keyword in the ReturnType list twice Method(mm1c, , , , {IntObj, IntObj}) {Store(1, Debug)} Method(mm1d, , , , {UnknownObj, UnknownObj}) {Store(1, Debug)}

// Simulteneously UnknownObj and a specific keyword in the ReturnType list Method(mm1e, , , , {UnknownObj, IntObj}) {Store(1, Debug)}

// NumArgs 0 but non-empty list of parameters Method(mm1f, 0, , , , IntObj) {Return ("mm1f")} Method(mm20, 0, , , , {IntObj}) {Return ("mm20")} Method(mm21, , , , , {IntObj}) {Return ("mm21")}

// NumArgs 1 but 2-element list of parameters Method(mm22, 1, , , , {IntObj, IntObj}) {Return ("mm22")}

// NumArgs 2 but 1-element list of parameters Method(mm23, 2, , , , {IntObj}) {Return ("mm23")}

// The same specific keyword in the ParameterType list twice Method(mm24, , , , {{IntObj, IntObj}}) {Store(1, Debug)} Method(mm25, , , , {{UnknownObj, UnknownObj}}) {Store(1, Debug)}

// Simulteneously UnknownObj and a specific keyword in the ParameterType list Method(mm26, , , , {{UnknownObj, IntObj}}) {Store(1, Debug)}

INTERNAL BUG NUMBER:

148

reedwind commented 11 years ago

Commented by: Valery Podrezov valery.a.podrezov@intel.com Commented at: 2006-05-24 21:15:43

Created an attachment (id=462) ASL code to reproduce the bug

reedwind commented 11 years ago

Commented by: Bob Moore robert.moore@intel.com Commented at: 2008-11-10 16:53:55

The parameter lists and return lists are ACPI 3.0 features that have not been implemented. They will be re-addressed with the introduction of ACPI 4.0. (399, 401, 437, 438)