@@ -327,6 +327,7 @@ pub enum SysCall {
327
327
/// * **Ok**: The Scalar / Send message was successfully sent, or the Borrow has finished
328
328
/// * **Scalar1**: The Server returned a `Scalar1` value
329
329
/// * **Scalar2**: The Server returned a `Scalar2` value
330
+ /// * **Scalar5**: The Server returned a `Scalar5` value
330
331
/// * **BlockedProcess**: In Hosted mode, the target process is now blocked
331
332
///
332
333
/// # Errors
@@ -342,6 +343,7 @@ pub enum SysCall {
342
343
/// * **Ok**: The Scalar / Send message was successfully sent, or the Borrow has finished
343
344
/// * **Scalar1**: The Server returned a `Scalar1` value
344
345
/// * **Scalar2**: The Server returned a `Scalar2` value
346
+ /// * **Scalar5**: The Server returned a `Scalar5` value
345
347
/// * **BlockedProcess**: In Hosted mode, the target process is now blocked
346
348
///
347
349
/// # Errors
@@ -1210,6 +1212,7 @@ impl SysCall {
1210
1212
SysCall :: TryConnect ( _)
1211
1213
| SysCall :: TryReceiveMessage ( _)
1212
1214
| SysCall :: ReturnToParent ( _, _)
1215
+ | SysCall :: ReturnScalar5 ( _, _, _, _, _, _)
1213
1216
| SysCall :: ReturnScalar2 ( _, _, _)
1214
1217
| SysCall :: ReturnScalar1 ( _, _)
1215
1218
| SysCall :: ReturnMemory ( _, _, _, _)
@@ -1352,6 +1355,25 @@ pub fn return_scalar2(
1352
1355
}
1353
1356
}
1354
1357
1358
+ /// Return 5 scalars to the provided message.
1359
+ pub fn return_scalar5 (
1360
+ sender : MessageSender ,
1361
+ val1 : usize ,
1362
+ val2 : usize ,
1363
+ val3 : usize ,
1364
+ val4 : usize ,
1365
+ val5 : usize ,
1366
+ ) -> core:: result:: Result < ( ) , Error > {
1367
+ let result = rsyscall ( SysCall :: ReturnScalar5 ( sender, val1, val2, val3, val4, val5) ) ?;
1368
+ if let crate :: Result :: Ok = result {
1369
+ Ok ( ( ) )
1370
+ } else if let Result :: Error ( e) = result {
1371
+ Err ( e)
1372
+ } else {
1373
+ Err ( Error :: InternalError )
1374
+ }
1375
+ }
1376
+
1355
1377
/// Claim a hardware interrupt for this process.
1356
1378
pub fn claim_interrupt (
1357
1379
irq_no : usize ,
@@ -1539,6 +1561,7 @@ pub fn try_send_message(connection: CID, message: Message) -> core::result::Resu
1539
1561
Ok ( Result :: Ok ) => Ok ( Result :: Ok ) ,
1540
1562
Ok ( Result :: Scalar1 ( a) ) => Ok ( Result :: Scalar1 ( a) ) ,
1541
1563
Ok ( Result :: Scalar2 ( a, b) ) => Ok ( Result :: Scalar2 ( a, b) ) ,
1564
+ Ok ( Result :: Scalar5 ( a, b, c, d, e) ) => Ok ( Result :: Scalar5 ( a, b, c, d, e) ) ,
1542
1565
Ok ( Result :: MemoryReturned ( offset, valid) ) => Ok ( Result :: MemoryReturned ( offset, valid) ) ,
1543
1566
Err ( e) => Err ( e) ,
1544
1567
v => panic ! ( "Unexpected return value: {:?}" , v) ,
@@ -1581,6 +1604,7 @@ pub fn send_message(connection: CID, message: Message) -> core::result::Result<R
1581
1604
Ok ( Result :: Ok ) => Ok ( Result :: Ok ) ,
1582
1605
Ok ( Result :: Scalar1 ( a) ) => Ok ( Result :: Scalar1 ( a) ) ,
1583
1606
Ok ( Result :: Scalar2 ( a, b) ) => Ok ( Result :: Scalar2 ( a, b) ) ,
1607
+ Ok ( Result :: Scalar5 ( a, b, c, d, e) ) => Ok ( Result :: Scalar5 ( a, b, c, d, e) ) ,
1584
1608
Ok ( Result :: MemoryReturned ( offset, valid) ) => Ok ( Result :: MemoryReturned ( offset, valid) ) ,
1585
1609
Err ( e) => Err ( e) ,
1586
1610
v => panic ! ( "Unexpected return value: {:?}" , v) ,
0 commit comments