diff --git a/repos/os/include/audio_in_session/audio_in_session.h b/repos/os/include/audio_in_session/audio_in_session.h index c01fe7abd8..1162cfd61d 100644 --- a/repos/os/include/audio_in_session/audio_in_session.h +++ b/repos/os/include/audio_in_session/audio_in_session.h @@ -293,7 +293,7 @@ class Audio_in::Session : public Genode::Session */ static const char *service_name() { return "Audio_in"; } - enum { CAP_QUOTA = 4 }; + static constexpr unsigned CAP_QUOTA = 4; /** * Return stream of this session, see 'Stream' above diff --git a/repos/os/include/audio_out_session/audio_out_session.h b/repos/os/include/audio_out_session/audio_out_session.h index c1d00e25d1..a903fa2f49 100644 --- a/repos/os/include/audio_out_session/audio_out_session.h +++ b/repos/os/include/audio_out_session/audio_out_session.h @@ -314,7 +314,7 @@ class Audio_out::Session : public Genode::Session */ static const char *service_name() { return "Audio_out"; } - enum { CAP_QUOTA = 4 }; + static constexpr unsigned CAP_QUOTA = 4; /** * Return stream of this session, see 'Stream' above diff --git a/repos/os/include/block_session/block_session.h b/repos/os/include/block_session/block_session.h index f08fc58954..8163c1489b 100644 --- a/repos/os/include/block_session/block_session.h +++ b/repos/os/include/block_session/block_session.h @@ -182,7 +182,7 @@ struct Block::Session : public Genode::Session */ static const char *service_name() { return "Block"; } - enum { CAP_QUOTA = 5 }; + static constexpr unsigned CAP_QUOTA = 5; virtual ~Session() { } diff --git a/repos/os/include/capture_session/capture_session.h b/repos/os/include/capture_session/capture_session.h index 6e17db7976..977d6188e4 100644 --- a/repos/os/include/capture_session/capture_session.h +++ b/repos/os/include/capture_session/capture_session.h @@ -47,7 +47,7 @@ struct Capture::Session : Genode::Session * session-object allocation, a session capability, and a dataspace * capability for the pixel buffer. */ - enum { CAP_QUOTA = 3 }; + static constexpr unsigned CAP_QUOTA = 3; /** * Return number of bytes needed for pixel buffer of specified size diff --git a/repos/os/include/event_session/event_session.h b/repos/os/include/event_session/event_session.h index b8e70fe243..d082a0f417 100644 --- a/repos/os/include/event_session/event_session.h +++ b/repos/os/include/event_session/event_session.h @@ -33,7 +33,7 @@ struct Event::Session : Genode::Session * session-object allocation, a dataspace capability for the event * buffer, and its session capability. */ - enum { CAP_QUOTA = 3 }; + static constexpr unsigned CAP_QUOTA = 3; /********************* diff --git a/repos/os/include/file_system_session/file_system_session.h b/repos/os/include/file_system_session/file_system_session.h index c8ce36653a..d48acf0505 100644 --- a/repos/os/include/file_system_session/file_system_session.h +++ b/repos/os/include/file_system_session/file_system_session.h @@ -330,7 +330,7 @@ struct File_system::Session : public Genode::Session */ static const char *service_name() { return "File_system"; } - enum { CAP_QUOTA = 12 }; + static constexpr unsigned CAP_QUOTA = 12; virtual ~Session() { } diff --git a/repos/os/include/gpio_session/gpio_session.h b/repos/os/include/gpio_session/gpio_session.h index 8eda199cb5..f09c3776fb 100644 --- a/repos/os/include/gpio_session/gpio_session.h +++ b/repos/os/include/gpio_session/gpio_session.h @@ -31,7 +31,7 @@ struct Gpio::Session : Genode::Session */ static const char *service_name() { return "Gpio"; } - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; enum Direction { IN, OUT }; diff --git a/repos/os/include/gpu_session/gpu_session.h b/repos/os/include/gpu_session/gpu_session.h index 86a39050b6..8a0175679c 100644 --- a/repos/os/include/gpu_session/gpu_session.h +++ b/repos/os/include/gpu_session/gpu_session.h @@ -112,7 +112,6 @@ struct Gpu::Virtual_address }; - /* * Gpu session interface */ @@ -124,12 +123,15 @@ struct Gpu::Session : public Genode::Session struct Conflicting_id : Genode::Exception { }; struct Mapping_vram_failed : Genode::Exception { }; - enum { REQUIRED_QUOTA = 1024 * 1024, CAP_QUOTA = 32, }; + static constexpr Genode::size_t REQUIRED_QUOTA = 1024*1024; + + static constexpr unsigned CAP_QUOTA = 32; static const char *service_name() { return "Gpu"; } virtual ~Session() { } + /*********************** ** Session interface ** ***********************/ diff --git a/repos/os/include/i2c_session/i2c_session.h b/repos/os/include/i2c_session/i2c_session.h index da3362a846..ae60f28858 100644 --- a/repos/os/include/i2c_session/i2c_session.h +++ b/repos/os/include/i2c_session/i2c_session.h @@ -32,7 +32,7 @@ struct I2c::Session : public Genode::Session */ static char const *service_name() { return "I2c"; } - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; /** * Exception thrown in case of a bus error diff --git a/repos/os/include/loader_session/loader_session.h b/repos/os/include/loader_session/loader_session.h index e8e713f255..d8bce00b0c 100644 --- a/repos/os/include/loader_session/loader_session.h +++ b/repos/os/include/loader_session/loader_session.h @@ -62,7 +62,7 @@ struct Loader::Session : Genode::Session */ static const char *service_name() { return "Loader"; } - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; virtual ~Session() { } diff --git a/repos/os/include/nic_session/nic_session.h b/repos/os/include/nic_session/nic_session.h index 3a9c1436c8..f2de2c9069 100644 --- a/repos/os/include/nic_session/nic_session.h +++ b/repos/os/include/nic_session/nic_session.h @@ -77,7 +77,7 @@ struct Nic::Session : Genode::Session * rx and tx, and four signal context capabilities for the data-flow * signals. */ - enum { CAP_QUOTA = 8 }; + static constexpr unsigned CAP_QUOTA = 8; virtual ~Session() { } diff --git a/repos/os/include/pin_control_session/pin_control_session.h b/repos/os/include/pin_control_session/pin_control_session.h index a222550d7a..df1ab4f845 100644 --- a/repos/os/include/pin_control_session/pin_control_session.h +++ b/repos/os/include/pin_control_session/pin_control_session.h @@ -36,7 +36,7 @@ struct Pin_control::Session : Genode::Session * A pin-control session consumes a dataspace capability for the server's * session-object allocation and its session capability. */ - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; virtual void state(bool) = 0; diff --git a/repos/os/include/pin_state_session/pin_state_session.h b/repos/os/include/pin_state_session/pin_state_session.h index 9aad384e74..396575327e 100644 --- a/repos/os/include/pin_state_session/pin_state_session.h +++ b/repos/os/include/pin_state_session/pin_state_session.h @@ -36,7 +36,7 @@ struct Pin_state::Session : Genode::Session * A pin-state session consumes a dataspace capability for the server's * session-object allocation and its session capability. */ - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; virtual bool state() const = 0; diff --git a/repos/os/include/platform_session/platform_session.h b/repos/os/include/platform_session/platform_session.h index 700e72dc79..a3bb66b917 100644 --- a/repos/os/include/platform_session/platform_session.h +++ b/repos/os/include/platform_session/platform_session.h @@ -57,7 +57,7 @@ struct Platform::Session : Genode::Session */ static const char *service_name() { return "Platform"; } - enum { CAP_QUOTA = 6 }; + static constexpr unsigned CAP_QUOTA = 6; virtual ~Session() { } diff --git a/repos/os/include/report_session/report_session.h b/repos/os/include/report_session/report_session.h index 5c327018e6..8e964df812 100644 --- a/repos/os/include/report_session/report_session.h +++ b/repos/os/include/report_session/report_session.h @@ -60,7 +60,7 @@ struct Report::Session : Genode::Session * session-object allocation, the session capability, and a dataspace * capability for the report buffer. */ - enum { CAP_QUOTA = 3 }; + static constexpr unsigned CAP_QUOTA = 3; typedef Session_client Client; diff --git a/repos/os/include/rtc_session/rtc_session.h b/repos/os/include/rtc_session/rtc_session.h index 968a2b0e3e..92a8ca21e5 100644 --- a/repos/os/include/rtc_session/rtc_session.h +++ b/repos/os/include/rtc_session/rtc_session.h @@ -55,7 +55,7 @@ struct Rtc::Session : Genode::Session */ static const char *service_name() { return "Rtc"; } - enum { CAP_QUOTA = 2 }; + static constexpr unsigned CAP_QUOTA = 2; /*********************** diff --git a/repos/os/include/terminal_session/terminal_session.h b/repos/os/include/terminal_session/terminal_session.h index 1ecf828172..e64d7ea933 100644 --- a/repos/os/include/terminal_session/terminal_session.h +++ b/repos/os/include/terminal_session/terminal_session.h @@ -34,7 +34,7 @@ struct Terminal::Session : Genode::Session * session-object allocation, its session capability, and a dataspace * capability for the communication buffer. */ - enum { CAP_QUOTA = 3 }; + static constexpr unsigned CAP_QUOTA = 3; class Size { diff --git a/repos/os/include/uplink_session/uplink_session.h b/repos/os/include/uplink_session/uplink_session.h index 0a813c8878..883744d719 100644 --- a/repos/os/include/uplink_session/uplink_session.h +++ b/repos/os/include/uplink_session/uplink_session.h @@ -72,7 +72,7 @@ struct Uplink::Session : Genode::Session * rx and tx, and four signal context capabilities for the data-flow * signals. */ - enum { CAP_QUOTA = 8 }; + static constexpr unsigned CAP_QUOTA = 8; virtual ~Session() { } diff --git a/repos/os/include/usb_session/usb_session.h b/repos/os/include/usb_session/usb_session.h index 4a5ffebf75..992c0527c8 100644 --- a/repos/os/include/usb_session/usb_session.h +++ b/repos/os/include/usb_session/usb_session.h @@ -181,7 +181,7 @@ struct Usb::Session : public Genode::Session */ static const char *service_name() { return "Usb"; } - enum { CAP_QUOTA = 5 }; + static constexpr unsigned CAP_QUOTA = 5; /** * Send from the server to the client upon device state change