Age | Commit message (Collapse) | Author | |
---|---|---|---|
2023-05-18 | libaml: tow eisaid inside the environment | mia soweli | |
2021-10-17 | libaml: resolve refs in ObjectType instruction | cinap_lenrek | |
The standard states in section 19.5.93: .... Notice that if this operation is performed on an obeject reference such as one produced by the Alias, Index, or RefOf statements, the obect type of the base object is returned. | |||
2021-10-17 | libaml: implement ObjectType instruction (thanks sigrid) | cinap_lenrek | |
2021-10-17 | libaml: implement ToString instruction | cinap_lenrek | |
2021-07-14 | libaml: fix gc bug, need to amltake()/amldrop() temporary buffer | cinap_lenrek | |
we have to protect the temporary buffer allocated by rwfield() as rwreg() calls amlmapio() which might cause further aml code execution causing gc() which frees it under us (as it is not referenced from the interpreter state). this fixes a panic on boot of a Lenovo Thinkpad P17 Gen1 Professional Mobile Workstation | |||
2021-02-22 | libaml: fix IndexField and BankField implementations (thanks Michael Forney) | cinap_lenrek | |
IndexField is supposed to increment the index value when an access is done with a bigger size than the data field. The index value is always a byte offset. Now that we always calculate the offset for each field unit access for IndexField, rename the indexv to bank (the bank value), as it is only used for that. Also, do not compare it with nil, as it is a integer constant which can be encoded as nil to mean zero. For BankField, the banking field was written using store(), which does nothing when the destination is a Field*. Use rwfield() to fix it in the new rwfieldunit(). Resolve all the Name*'s when IndexField, BankField and Field are created. Now, Field.reg points to eigther Buffer object, Region or Field (data Field of an IndexField). PS: initial bug report by Michael Forney follows below: In /dev/kmesg on my T14, I saw a message amlmapio: [0xffffff18-0x100000018] overlaps usable memory amlmapio: mapping \_SB.FRTP failed Here is the relevant snippet from my DSDT: Scope (_SB) { ... OperationRegion (ECMC, SystemIO, 0x72, 0x02) Field (ECMC, AnyAcc, NoLock, Preserve) { ECMI, 8, ECMD, 8 } IndexField (ECMI, ECMD, ByteAcc, NoLock, Preserve) { Offset (0x08), FRTB, 32 } OperationRegion (FRTP, SystemMemory, FRTB, 0x0100) Field (FRTP, AnyAcc, NoLock, Preserve) { ... } } With some debugging output: amlmapio(\_SB.ECMC): Io 72 - 74 rwreg(\_SB.ECMC): Io [72+0]/1 <- 8 rwreg(\_SB.ECMC): Io [72+1]/1 -> 18 amlmapio(\_SB.FRTP): Mem ffffff18 - 100000018 amlmapio: [0xffffff18-0x100000018) overlaps usable memory amlmapio: mapping \_SB.FRTP failed It seems that libaml does not handle IndexField correctly and just did a single read from ECMD after setting ECMI to 8, causing the FRTP region to be evaluated as 0xffffff18-0x100000018. Instead, it should be reading 4 bytes [18 c0 22 cc], evaluating it as 0xcc22c018-0xcc22118: amlmapio(\_SB.ECMC): Io 72 - 74 rwreg(\_SB.ECMC): Io [72+0]/1 <- 8 rwreg(\_SB.ECMC): Io [72+1]/1 -> 18 rwreg(\_SB.ECMC): Io [72+0]/1 <- 9 rwreg(\_SB.ECMC): Io [72+1]/1 -> c0 rwreg(\_SB.ECMC): Io [72+0]/1 <- a rwreg(\_SB.ECMC): Io [72+1]/1 -> 22 rwreg(\_SB.ECMC): Io [72+0]/1 <- b rwreg(\_SB.ECMC): Io [72+1]/1 -> cc amlmapio(\_SB.FRTP): Mem cc22c018 - cc22c118 I wrote a patch (attached) to fix this, and it seems to work. Though, it's not clear to me when things should be dereferenced. Previously, the data field was dereferenced at evalfield, but the region and index field were not until rwfield. After the patch, the index field is also dereferenced in evalfield. For BankField, the index *is* dereferenced in evalfield. I'm pretty sure that this means that BankField does not work currently, since store() just returns nil for 'f' objects. The bank selector will never get set. Anyway, I don't know if this solves any real problems; it's just something I noticed and thought I'd try to fix. | |||
2020-10-21 | libaml: add (nop) "signal" op | Sigrid | |
2020-08-20 | libaml: fix fault when the second operand of comparison cannot be converted | Sigrid | |
2020-05-23 | libaml: implement ToDecimalString and ToHexString operations | cinap_lenrek | |
2018-11-04 | libaml: allow amlmapio() to re-enter the interpreter (can happen by pciadd() ↵ | cinap_lenrek | |
-> amleval()) - make frame base pointer variable - in rwreg(), save/restore the interpreter state and allocate a Frame* on the stack - add overflow checks for frame base pointer to xec() and amleval() - gc() scans the whole stack from FP to the *real* bottom F0 | |||
2017-02-24 | libaml: make heap size field int, implement BankField definitions | cinap_lenrek | |
2016-06-05 | aml: define amlintmask and set it according to DSDT revision (64bit / 32bit) | cinap_lenrek | |
2016-06-04 | aml: implement ToInteger() and Match() instructions | cinap_lenrek | |
2016-01-07 | format pointer subtraction results with %zd instead of %ld (for long -> ↵ | cinap_lenrek | |
intptr on amd64) | |||
2013-09-07 | libaml: fix formating | cinap_lenrek | |
2013-09-07 | libaml: fix uninitialized variable in getle(), make amleval() work with ↵ | cinap_lenrek | |
buildin methods | |||
2013-09-07 | libaml: use FP->env to access method arguments instead of FP->arg in evalosi() | cinap_lenrek | |
2013-09-07 | libaml: amldelay(), _OSI(), fix bug in Load() (from plhk's acpi patch) | cinap_lenrek | |
export amldelay() for microsecond sleeps. implement _OSI() method. fix rwreg argument in evalload() | |||
2013-09-06 | libaml: new io interface, add amlnew()/amltake()/amldrop(), late binding ↵ | cinap_lenrek | |
names, FindSetLeftBit/FindSetRightBit new io interface was added. user defines amlmapio() and amlunmapio() functions that will fill out Amlio structure with function pointers to read/write routines for a particular region. amlnew() function added allowing the creation of aml objects like buffers or packages. these can be passed to amleval() with b, p or * format. amltake()/amldrop() exclude an aml object from garbage collection. on load, names are not always resolvable until the whole table is loaded. for this, we create n objects that are just name strings. after load, we recursively traverse the namespace and resolve them (see fixnames()). the FindSetLeftBit and FindSetRightBit opcodes got implemened. | |||
2013-07-12 | aml: preserve reference type when indexing into package to prevent implicit ↵ | cinap_lenrek | |
type conversion when storing to arg or local if LocalX or ArgX is a package, the store into a element should *not* type convert. so when taking the index reference, we have to carry over the type. | |||
2013-06-29 | libaml: add Concatenate instruction, fix type conversions | cinap_lenrek | |
2013-06-29 | libaml: add Load and Unload instructions | cinap_lenrek | |
not very usefull at the moment as theres no code to map/unmap memory regions right now. | |||
2013-06-18 | libaml: pikeshedd style, handle division by zero (thanks erik) | cinap_lenrek | |
2013-06-07 | libaml: create \_GL name object | cinap_lenrek | |
2013-06-04 | libaml: various fixes found by plhk | cinap_lenrek | |
- fix bogus execution of Else{} blocks - always allocate Env in amleval() - add Sleep() and Stall() instructions - keep package size for packages with empty body | |||
2012-09-09 | libaml: store *value* instead of name reference in dest for alias op | cinap_lenrek | |
2012-09-08 | libaml: implement Alias and Debug instructions | cinap_lenrek | |
2012-06-17 | experimental acpi support for apic irq routing | cinap_lenrek | |