@@ -737,7 +737,7 @@ where
737737 }
738738 Opcode :: Acquire => {
739739 let [ Argument :: Object ( mutex) ] = & op. arguments [ ..] else { panic ! ( ) } ;
740- let Object :: Mutex { mutex, sync_level } = * * mutex else {
740+ let Object :: Mutex { mutex, sync_level : _ } = * * mutex else {
741741 Err ( AmlError :: InvalidOperationOnObject { op : Operation :: Acquire , typ : mutex. typ ( ) } ) ?
742742 } ;
743743 let timeout = context. next_u16 ( ) ?;
@@ -753,7 +753,7 @@ where
753753 }
754754 Opcode :: Release => {
755755 let [ Argument :: Object ( mutex) ] = & op. arguments [ ..] else { panic ! ( ) } ;
756- let Object :: Mutex { mutex, sync_level } = * * mutex else {
756+ let Object :: Mutex { mutex, sync_level : _ } = * * mutex else {
757757 Err ( AmlError :: InvalidOperationOnObject { op : Operation :: Release , typ : mutex. typ ( ) } ) ?
758758 } ;
759759
@@ -1348,7 +1348,7 @@ where
13481348 let behaviour = if context. current_block . kind == BlockKind :: Package {
13491349 ResolveBehaviour :: PackageElement
13501350 } else if context. current_block . kind == BlockKind :: VarPackage {
1351- if context. last_op ( ) ?. arguments . len ( ) == 0 {
1351+ if context. last_op ( ) ?. arguments . is_empty ( ) {
13521352 ResolveBehaviour :: ResolveToObject
13531353 } else {
13541354 ResolveBehaviour :: PackageElement
@@ -2146,7 +2146,7 @@ where
21462146 match kind {
21472147 ReferenceKind :: RefOf => todo ! ( ) ,
21482148 ReferenceKind :: LocalOrArg => {
2149- if let Object :: Reference { kind : inner_kind , inner : inner_inner } = & * * inner {
2149+ if let Object :: Reference { kind : _inner_kind , inner : inner_inner } = & * * inner {
21502150 // TODO: this should store into the reference, potentially doing an
21512151 // implicit cast
21522152 unsafe {
@@ -2205,15 +2205,15 @@ where
22052205
22062206 let read_region = match field. kind {
22072207 FieldUnitKind :: Normal { ref region } => region,
2208- FieldUnitKind :: Bank { ref region, ref bank, bank_value } => {
2208+ // FieldUnitKind::Bank { ref region, ref bank, bank_value } => {
2209+ FieldUnitKind :: Bank { .. } => {
22092210 // TODO: put the bank_value in the bank
22102211 todo ! ( ) ;
2211- region
22122212 }
2213- FieldUnitKind :: Index { ref index, ref data } => {
2213+ // FieldUnitKind::Index { ref index, ref data } => {
2214+ FieldUnitKind :: Index { .. } => {
22142215 // TODO: configure the correct index
22152216 todo ! ( ) ;
2216- data
22172217 }
22182218 } ;
22192219 let Object :: OpRegion ( ref read_region) = * * read_region else { panic ! ( ) } ;
@@ -2265,15 +2265,15 @@ where
22652265
22662266 let write_region = match field. kind {
22672267 FieldUnitKind :: Normal { ref region } => region,
2268- FieldUnitKind :: Bank { ref region, ref bank, bank_value } => {
2268+ // FieldUnitKind::Bank { ref region, ref bank, bank_value } => {
2269+ FieldUnitKind :: Bank { .. } => {
22692270 // TODO: put the bank_value in the bank
22702271 todo ! ( ) ;
2271- region
22722272 }
2273- FieldUnitKind :: Index { ref index, ref data } => {
2273+ // FieldUnitKind::Index { ref index, ref data } => {
2274+ FieldUnitKind :: Index { .. } => {
22742275 // TODO: configure the correct index
22752276 todo ! ( ) ;
2276- data
22772277 }
22782278 } ;
22792279 let Object :: OpRegion ( ref write_region) = * * write_region else { panic ! ( ) } ;
@@ -2373,8 +2373,9 @@ where
23732373 | RegionSpace :: GenericSerialBus
23742374 | RegionSpace :: Pcc
23752375 | RegionSpace :: Oem ( _) => {
2376- if let Some ( handler) = self . region_handlers . lock ( ) . get ( & region. space ) {
2377- todo ! ( "Utilise handler" ) ;
2376+ if let Some ( _handler) = self . region_handlers . lock ( ) . get ( & region. space ) {
2377+ warn ! ( "Custom region handlers aren't actually supported yet." ) ;
2378+ Err ( AmlError :: LibUnimplemented )
23782379 } else {
23792380 Err ( AmlError :: NoHandlerForRegionAccess ( region. space ) )
23802381 }
@@ -2439,8 +2440,9 @@ where
24392440 | RegionSpace :: GenericSerialBus
24402441 | RegionSpace :: Pcc
24412442 | RegionSpace :: Oem ( _) => {
2442- if let Some ( handler) = self . region_handlers . lock ( ) . get ( & region. space ) {
2443- todo ! ( "Utilise handler" ) ;
2443+ if let Some ( _handler) = self . region_handlers . lock ( ) . get ( & region. space ) {
2444+ warn ! ( "Custom region handlers aren't actually supported yet." ) ;
2445+ Err ( AmlError :: LibUnimplemented )
24442446 } else {
24452447 Err ( AmlError :: NoHandlerForRegionAccess ( region. space ) )
24462448 }
@@ -3057,9 +3059,15 @@ pub enum AmlError {
30573059
30583060 MethodArgCountIncorrect ,
30593061
3060- InvalidOperationOnObject { op : Operation , typ : ObjectType } ,
3062+ InvalidOperationOnObject {
3063+ op : Operation ,
3064+ typ : ObjectType ,
3065+ } ,
30613066 IndexOutOfBounds ,
3062- ObjectNotOfExpectedType { expected : ObjectType , got : ObjectType } ,
3067+ ObjectNotOfExpectedType {
3068+ expected : ObjectType ,
3069+ got : ObjectType ,
3070+ } ,
30633071
30643072 InvalidResourceDescriptor ,
30653073 UnexpectedResourceType ,
@@ -3072,4 +3080,8 @@ pub enum AmlError {
30723080 PrtInvalidGsi ,
30733081 PrtInvalidSource ,
30743082 PrtNoEntry ,
3083+
3084+ /// This is emitted to signal that the library does not support the requested behaviour. This
3085+ /// should eventually never be emitted.
3086+ LibUnimplemented ,
30753087}
0 commit comments