@@ -737,7 +737,7 @@ where
737
737
}
738
738
Opcode :: Acquire => {
739
739
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 {
741
741
Err ( AmlError :: InvalidOperationOnObject { op : Operation :: Acquire , typ : mutex. typ ( ) } ) ?
742
742
} ;
743
743
let timeout = context. next_u16 ( ) ?;
@@ -753,7 +753,7 @@ where
753
753
}
754
754
Opcode :: Release => {
755
755
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 {
757
757
Err ( AmlError :: InvalidOperationOnObject { op : Operation :: Release , typ : mutex. typ ( ) } ) ?
758
758
} ;
759
759
@@ -1348,7 +1348,7 @@ where
1348
1348
let behaviour = if context. current_block . kind == BlockKind :: Package {
1349
1349
ResolveBehaviour :: PackageElement
1350
1350
} else if context. current_block . kind == BlockKind :: VarPackage {
1351
- if context. last_op ( ) ?. arguments . len ( ) == 0 {
1351
+ if context. last_op ( ) ?. arguments . is_empty ( ) {
1352
1352
ResolveBehaviour :: ResolveToObject
1353
1353
} else {
1354
1354
ResolveBehaviour :: PackageElement
@@ -2146,7 +2146,7 @@ where
2146
2146
match kind {
2147
2147
ReferenceKind :: RefOf => todo ! ( ) ,
2148
2148
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 {
2150
2150
// TODO: this should store into the reference, potentially doing an
2151
2151
// implicit cast
2152
2152
unsafe {
@@ -2205,15 +2205,15 @@ where
2205
2205
2206
2206
let read_region = match field. kind {
2207
2207
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 { .. } => {
2209
2210
// TODO: put the bank_value in the bank
2210
2211
todo ! ( ) ;
2211
- region
2212
2212
}
2213
- FieldUnitKind :: Index { ref index, ref data } => {
2213
+ // FieldUnitKind::Index { ref index, ref data } => {
2214
+ FieldUnitKind :: Index { .. } => {
2214
2215
// TODO: configure the correct index
2215
2216
todo ! ( ) ;
2216
- data
2217
2217
}
2218
2218
} ;
2219
2219
let Object :: OpRegion ( ref read_region) = * * read_region else { panic ! ( ) } ;
@@ -2265,15 +2265,15 @@ where
2265
2265
2266
2266
let write_region = match field. kind {
2267
2267
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 { .. } => {
2269
2270
// TODO: put the bank_value in the bank
2270
2271
todo ! ( ) ;
2271
- region
2272
2272
}
2273
- FieldUnitKind :: Index { ref index, ref data } => {
2273
+ // FieldUnitKind::Index { ref index, ref data } => {
2274
+ FieldUnitKind :: Index { .. } => {
2274
2275
// TODO: configure the correct index
2275
2276
todo ! ( ) ;
2276
- data
2277
2277
}
2278
2278
} ;
2279
2279
let Object :: OpRegion ( ref write_region) = * * write_region else { panic ! ( ) } ;
@@ -2373,8 +2373,9 @@ where
2373
2373
| RegionSpace :: GenericSerialBus
2374
2374
| RegionSpace :: Pcc
2375
2375
| 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 )
2378
2379
} else {
2379
2380
Err ( AmlError :: NoHandlerForRegionAccess ( region. space ) )
2380
2381
}
@@ -2439,8 +2440,9 @@ where
2439
2440
| RegionSpace :: GenericSerialBus
2440
2441
| RegionSpace :: Pcc
2441
2442
| 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 )
2444
2446
} else {
2445
2447
Err ( AmlError :: NoHandlerForRegionAccess ( region. space ) )
2446
2448
}
@@ -3057,9 +3059,15 @@ pub enum AmlError {
3057
3059
3058
3060
MethodArgCountIncorrect ,
3059
3061
3060
- InvalidOperationOnObject { op : Operation , typ : ObjectType } ,
3062
+ InvalidOperationOnObject {
3063
+ op : Operation ,
3064
+ typ : ObjectType ,
3065
+ } ,
3061
3066
IndexOutOfBounds ,
3062
- ObjectNotOfExpectedType { expected : ObjectType , got : ObjectType } ,
3067
+ ObjectNotOfExpectedType {
3068
+ expected : ObjectType ,
3069
+ got : ObjectType ,
3070
+ } ,
3063
3071
3064
3072
InvalidResourceDescriptor ,
3065
3073
UnexpectedResourceType ,
@@ -3072,4 +3080,8 @@ pub enum AmlError {
3072
3080
PrtInvalidGsi ,
3073
3081
PrtInvalidSource ,
3074
3082
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 ,
3075
3087
}
0 commit comments