Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase max PD name length to 64 #224

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libmicrokit/include/microkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ typedef seL4_MessageInfo_t microkit_msginfo;
#define BASE_VCPU_CAP 330

#define MICROKIT_MAX_CHANNELS 62
#define MICROKIT_PD_NAME_LENGTH 64

/* User provided functions */
void init(void);
void notified(microkit_channel ch);
microkit_msginfo protected(microkit_channel ch, microkit_msginfo msginfo);
seL4_Bool fault(microkit_child child, microkit_msginfo msginfo, microkit_msginfo *reply_msginfo);

extern char microkit_name[16];
extern char microkit_name[MICROKIT_PD_NAME_LENGTH];
/* These next three variables are so our PDs can combine a signal with the next Recv syscall */
extern seL4_Bool microkit_have_signal;
extern seL4_CPtr microkit_signal_cap;
Expand Down
2 changes: 1 addition & 1 deletion libmicrokit/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/* All globals are prefixed with microkit_* to avoid clashes with user defined globals. */

bool microkit_passive;
char microkit_name[16];
char microkit_name[MICROKIT_PD_NAME_LENGTH];
/* We use seL4 typedefs as this variable is exposed to the libmicrokit header
* and we do not want to rely on compiler built-in defines. */
seL4_Bool microkit_have_signal = seL4_False;
Expand Down
2 changes: 1 addition & 1 deletion monitor/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#include "debug.h"

#define MAX_PDS 64
#define MAX_NAME_LEN 16
#define MAX_NAME_LEN 64
#define MAX_TCBS 64

#define MAX_UNTYPED_REGIONS 256
Expand Down
2 changes: 1 addition & 1 deletion tool/microkit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub const MAX_PDS: usize = 63;
// It should be noted that if you were to change the value of
// the maximum PD name length, you would also have to change
// the monitor and libmicrokit.
pub const PD_MAX_NAME_LENGTH: usize = 16;
pub const PD_MAX_NAME_LENGTH: usize = 64;

#[derive(Debug, Copy, Clone, PartialEq)]
pub struct UntypedObject {
Expand Down
3 changes: 3 additions & 0 deletions tool/microkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3580,6 +3580,9 @@ fn main() -> Result<(), String> {
let name_length = min(name.len(), PD_MAX_NAME_LENGTH);
let end = start + name_length;
pd_names_bytes[start..end].copy_from_slice(&name[..name_length]);
// These bytes will be interpreted as a C string, so we must include
// a null-terminator.
pd_names_bytes[start + PD_MAX_NAME_LENGTH - 1] = 0;
}
monitor_elf.write_symbol("pd_names", &pd_names_bytes)?;

Expand Down
Loading