Skip to content

Commit 0bbb0c6

Browse files
authored
Fix RPi4 failing sel4test in Release mode
Signed-off-by: Jakub Duchniewicz <[email protected]>
1 parent 827af38 commit 0bbb0c6

File tree

1 file changed

+7
-6
lines changed
  • apps/sel4test-driver/src

1 file changed

+7
-6
lines changed

apps/sel4test-driver/src/main.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,11 @@ void *main_continued(void *arg UNUSED)
484484

485485
/* Note that the following globals are place here because it is not expected that
486486
* this function be refactored out of sel4test-driver in its current form. */
487-
/* Number of objects to track allocation of. Currently all serial devices are
488-
* initialised with a single Frame object. Future devices may need more than 1.
487+
/* Number of objects to track allocation of. Currently all serial devices but
488+
* bcm2711 and bcm2837 are initialised with a single Frame object. In future
489+
* devices some other devices may need more than two, so keep some margin.
489490
*/
490-
#define NUM_ALLOC_AT_TO_TRACK 1
491+
#define MAX_ALLOC_AT_TO_TRACK 4
491492
/* Static global to store the original vka_utspace_alloc_at function. It
492493
* isn't expected for this to dynamically change after initialisation.*/
493494
static vka_utspace_alloc_at_fn vka_utspace_alloc_at_base;
@@ -503,15 +504,15 @@ typedef struct uspace_alloc_at_args {
503504
cspacepath_t dest;
504505
} uspace_alloc_at_args_t;
505506
/* This instance of vka_utspace_alloc_at_fn will keep a record of allocations up
506-
* to NUM_ALLOC_AT_TO_TRACK while serial_utspace_record is set. When serial_utspace_record
507+
* to MAX_ALLOC_AT_TO_TRACK while serial_utspace_record is set. When serial_utspace_record
507508
* is unset, any allocations matching recorded allocations will instead copy the cap
508509
* that was originally allocated. These subsequent allocations cannot be freed using
509510
* vka_utspace_free and instead the caps would have to be manually deleted.
510511
* Freeing these objects via vka_utspace_free would require also wrapping that function.*/
511512
static int serial_utspace_alloc_at_fn(void *data, const cspacepath_t *dest, seL4_Word type, seL4_Word size_bits,
512513
uintptr_t paddr, seL4_Word *cookie)
513514
{
514-
static uspace_alloc_at_args_t args_prev[NUM_ALLOC_AT_TO_TRACK] = {};
515+
static uspace_alloc_at_args_t args_prev[MAX_ALLOC_AT_TO_TRACK] = {};
515516
static size_t num_alloc = 0;
516517

517518
ZF_LOGF_IF(!vka_utspace_alloc_at_base, "vka_utspace_alloc_at_base not initialised.");
@@ -525,7 +526,7 @@ static int serial_utspace_alloc_at_fn(void *data, const cspacepath_t *dest, seL4
525526
}
526527
return vka_utspace_alloc_at_base(data, dest, type, size_bits, paddr, cookie);
527528
} else {
528-
ZF_LOGF_IF(num_alloc >= NUM_ALLOC_AT_TO_TRACK, "Trying to allocate too many utspace objects");
529+
ZF_LOGF_IF(num_alloc >= MAX_ALLOC_AT_TO_TRACK, "Trying to allocate too many utspace objects");
529530
int ret = vka_utspace_alloc_at_base(data, dest, type, size_bits, paddr, cookie);
530531
if (ret) {
531532
return ret;

0 commit comments

Comments
 (0)