From 15141f3ca737373c79cff4daed03e4dacfaa5f08 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 11 May 2016 17:23:51 +0200 Subject: [PATCH] Remove hand-crafted Rpc_functions typedefs --- repos/base/include/cpu_session/cpu_session.h | 22 ++------------- repos/base/include/cpu_thread/cpu_thread.h | 28 ++++--------------- repos/base/include/parent/parent.h | 17 +++-------- repos/base/include/pd_session/pd_session.h | 23 ++++----------- .../include/trace_session/trace_session.h | 18 +++--------- .../file_system_session/file_system_session.h | 23 ++------------- .../include/loader_session/loader_session.h | 25 +++-------------- .../nitpicker_session/nitpicker_session.h | 27 ++++-------------- .../x86/platform_device/platform_device.h | 15 ++-------- 9 files changed, 36 insertions(+), 162 deletions(-) diff --git a/repos/base/include/cpu_session/cpu_session.h b/repos/base/include/cpu_session/cpu_session.h index f189987ab2..3c0f157cdc 100644 --- a/repos/base/include/cpu_session/cpu_session.h +++ b/repos/base/include/cpu_session/cpu_session.h @@ -227,25 +227,9 @@ struct Genode::Cpu_session : Session GENODE_RPC(Rpc_quota, Quota, quota); GENODE_RPC(Rpc_native_cpu, Capability, native_cpu); - /* - * 'GENODE_RPC_INTERFACE' declaration done manually - * - * The number of RPC functions of this interface exceeds the maximum - * number of elements supported by 'Meta::Type_list'. Therefore, we - * construct the type list by hand using nested type tuples instead - * of employing the convenience macro 'GENODE_RPC_INTERFACE'. - */ - typedef Meta::Type_tuple - > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_create_thread, Rpc_kill_thread, Rpc_exception_sigh, + Rpc_affinity_space, Rpc_trace_control, Rpc_ref_account, + Rpc_transfer_quota, Rpc_quota, Rpc_native_cpu); }; diff --git a/repos/base/include/cpu_thread/cpu_thread.h b/repos/base/include/cpu_thread/cpu_thread.h index 4c71ffa6ed..44435f2d2d 100644 --- a/repos/base/include/cpu_thread/cpu_thread.h +++ b/repos/base/include/cpu_thread/cpu_thread.h @@ -154,29 +154,11 @@ struct Genode::Cpu_thread GENODE_RPC(Rpc_trace_buffer, Dataspace_capability, trace_buffer); GENODE_RPC(Rpc_trace_policy, Dataspace_capability, trace_policy); - /* - * 'GENODE_RPC_INTERFACE' declaration done manually - * - * The number of RPC functions of this interface exceeds the maximum - * number of elements supported by 'Meta::Type_list'. Therefore, we - * construct the type list by hand using nested type tuples instead - * of employing the convenience macro 'GENODE_RPC_INTERFACE'. - */ - typedef Meta::Type_tuple - > > > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_utcb, Rpc_start, Rpc_pause, Rpc_resume, + Rpc_cancel_blocking, Rpc_set_state, Rpc_get_state, + Rpc_exception_sigh, Rpc_single_step, Rpc_affinity, + Rpc_trace_control_index, Rpc_trace_buffer, + Rpc_trace_policy); }; #endif /* _INCLUDE__CPU_THREAD__CPU_THREAD_H_ */ diff --git a/repos/base/include/parent/parent.h b/repos/base/include/parent/parent.h index 31610382f4..a15b7d4262 100644 --- a/repos/base/include/parent/parent.h +++ b/repos/base/include/parent/parent.h @@ -250,19 +250,10 @@ class Genode::Parent GENODE_RPC(Rpc_yield_request, Resource_args, yield_request); GENODE_RPC(Rpc_yield_response, void, yield_response); - typedef Meta::Type_tuple - > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_exit, Rpc_announce, Rpc_session, Rpc_upgrade, + Rpc_close, Rpc_main_thread, Rpc_resource_avail_sigh, + Rpc_resource_request, Rpc_yield_sigh, Rpc_yield_request, + Rpc_yield_response); }; diff --git a/repos/base/include/pd_session/pd_session.h b/repos/base/include/pd_session/pd_session.h index f553be4cf2..0074b93abd 100644 --- a/repos/base/include/pd_session/pd_session.h +++ b/repos/base/include/pd_session/pd_session.h @@ -209,24 +209,11 @@ struct Genode::Pd_session : Session GENODE_RPC(Rpc_native_pd, Capability, native_pd); - /* - * Manual definition of 'Rpc_functions', see the comment in cpu_session.h. - */ - typedef Meta::Type_tuple - > > > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_assign_parent, Rpc_assign_pci, + Rpc_alloc_signal_source, Rpc_free_signal_source, + Rpc_alloc_context, Rpc_free_context, Rpc_submit, + Rpc_alloc_rpc_cap, Rpc_free_rpc_cap, Rpc_address_space, + Rpc_stack_area, Rpc_linker_area, Rpc_native_pd); }; #endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */ diff --git a/repos/base/include/trace_session/trace_session.h b/repos/base/include/trace_session/trace_session.h index a693c3c5f8..32cff4f7d9 100644 --- a/repos/base/include/trace_session/trace_session.h +++ b/repos/base/include/trace_session/trace_session.h @@ -141,20 +141,10 @@ struct Genode::Trace::Session : Genode::Session GENODE_RPC_THROW(Rpc_free, void, free, GENODE_TYPE_LIST(Nonexistent_subject), Subject_id); - typedef Meta::Type_tuple - > > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_dataspace, Rpc_alloc_policy, Rpc_policy, + Rpc_unload_policy, Rpc_trace, Rpc_rule, Rpc_pause, + Rpc_resume, Rpc_subjects, Rpc_subject_info, Rpc_buffer, + Rpc_free); }; #endif /* _INCLUDE__TRACE_SESSION__TRACE_SESSION_H_ */ 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 9527647d23..493ced9137 100644 --- a/repos/os/include/file_system_session/file_system_session.h +++ b/repos/os/include/file_system_session/file_system_session.h @@ -388,26 +388,9 @@ struct File_system::Session : public Genode::Session Node_handle, Genode::Signal_context_capability); GENODE_RPC(Rpc_sync, void, sync, Node_handle); - /* - * Manual type-list definition, needed because the RPC interface - * exceeds the maximum number of type-list elements supported by - * 'Genode::Meta::Type_list<>'. - */ - typedef Genode::Meta::Type_tuple - > > > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_tx_cap, Rpc_file, Rpc_symlink, Rpc_dir, Rpc_node, + Rpc_close, Rpc_status, Rpc_control, Rpc_unlink, + Rpc_truncate, Rpc_move, Rpc_sigh, Rpc_sync); }; #endif /* _INCLUDE__FILE_SYSTEM_SESSION__FILE_SYSTEM_SESSION_H_ */ diff --git a/repos/os/include/loader_session/loader_session.h b/repos/os/include/loader_session/loader_session.h index 5764cd10a2..f8935b59a1 100644 --- a/repos/os/include/loader_session/loader_session.h +++ b/repos/os/include/loader_session/loader_session.h @@ -31,7 +31,6 @@ namespace Loader { using Genode::Dataspace_capability; using Genode::Signal_context_capability; - using Genode::Meta::Type_tuple; struct Session; } @@ -179,26 +178,10 @@ struct Loader::Session : Genode::Session GENODE_RPC_THROW(Rpc_view_size, Area, view_size, GENODE_TYPE_LIST(View_does_not_exist)); - /* - * 'GENODE_RPC_INTERFACE' declaration done manually - * - * The number of RPC function of this interface exceeds the maximum - * number of elements supported by 'Meta::Type_list'. Therefore, we - * construct the type list by hand using nested type tuples instead - * of employing the convenience macro 'GENODE_RPC_INTERFACE'. - */ - typedef Type_tuple - > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_alloc_rom_module, Rpc_commit_rom_module, + Rpc_ram_quota, Rpc_constrain_geometry, + Rpc_parent_view, Rpc_view_ready_sigh, Rpc_fault_sigh, + Rpc_start, Rpc_view_geometry, Rpc_view_size); }; #endif /* _INCLUDE__LOADER_SESSION__LOADER_SESSION_H_ */ diff --git a/repos/os/include/nitpicker_session/nitpicker_session.h b/repos/os/include/nitpicker_session/nitpicker_session.h index 7353aabdc7..ef6dc6df12 100644 --- a/repos/os/include/nitpicker_session/nitpicker_session.h +++ b/repos/os/include/nitpicker_session/nitpicker_session.h @@ -30,7 +30,6 @@ namespace Nitpicker { typedef Genode::Surface_base::Rect Rect; typedef Genode::Surface_base::Point Point; typedef Genode::Surface_base::Area Area; - using Genode::Meta::Type_tuple; } @@ -332,27 +331,11 @@ struct Nitpicker::Session : Genode::Session GENODE_RPC_THROW(Rpc_buffer, void, buffer, GENODE_TYPE_LIST(Out_of_metadata), Framebuffer::Mode, bool); - /* - * The 'GENODE_RPC_INTERFACE' declaration is done manually because the - * number of RPC functions exceeds the maxium arguments supported by the - * 'Type_list' template. - */ - typedef Type_tuple - > > > > > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_framebuffer_session, Rpc_input_session, + Rpc_create_view, Rpc_destroy_view, Rpc_view_handle, + Rpc_view_capability, Rpc_release_view_handle, + Rpc_command_dataspace, Rpc_execute, Rpc_mode, + Rpc_mode_sigh, Rpc_buffer, Rpc_focus, Rpc_session_control); }; #endif /* _INCLUDE__NITPICKER_SESSION__NITPICKER_SESSION_H_ */ diff --git a/repos/os/include/spec/x86/platform_device/platform_device.h b/repos/os/include/spec/x86/platform_device/platform_device.h index d61598bf5d..d9da043c4a 100644 --- a/repos/os/include/spec/x86/platform_device/platform_device.h +++ b/repos/os/include/spec/x86/platform_device/platform_device.h @@ -246,16 +246,7 @@ struct Platform::Device : Platform::Abstract_device Genode::uint8_t, Genode::Cache_attribute, Genode::addr_t, Genode::size_t); - typedef Genode::Meta::Type_tuple - > > > > > > > > > Rpc_functions; + GENODE_RPC_INTERFACE(Rpc_bus_address, Rpc_vendor_id, Rpc_device_id, + Rpc_class_code, Rpc_resource, Rpc_config_read, + Rpc_config_write, Rpc_irq, Rpc_io_port, Rpc_io_mem); };