1.1 --- a/pkg/devices/cpm/src/jz4730/cpm-jz4730.cc Sat Jun 10 23:59:44 2023 +0200
1.2 +++ b/pkg/devices/cpm/src/jz4730/cpm-jz4730.cc Sun Jun 11 15:42:11 2023 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * JZ4730 CPM server.
1.6 *
1.7 - * Copyright (C) 2018, 2020, 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2020, 2021, 2023 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -25,6 +25,7 @@
1.13 #include <l4/re/env.h>
1.14
1.15 #include <ipc/server.h>
1.16 +
1.17 #include "cpm_server.h"
1.18
1.19 /* Virtual addresses for the CPM and LCD register blocks. */
1.20 @@ -47,12 +48,12 @@
1.21
1.22 /* CPM server. */
1.23
1.24 -class server_CPM : public CPM
1.25 +class CPM_server : public CPM
1.26 {
1.27 Cpm_jz4730_chip *_chip;
1.28
1.29 public:
1.30 - explicit server_CPM(Cpm_jz4730_chip *chip)
1.31 + explicit CPM_server(Cpm_jz4730_chip *chip)
1.32 : _chip(chip)
1.33 {
1.34 }
1.35 @@ -94,7 +95,8 @@
1.36
1.37 int main(void)
1.38 {
1.39 - if (setup_memory()) return 1;
1.40 + if (setup_memory())
1.41 + return 1;
1.42
1.43 /* Initialise the CPM abstraction. */
1.44
1.45 @@ -102,14 +104,12 @@
1.46
1.47 /* Initialise and register a server object. */
1.48
1.49 - server_CPM obj(&cpm_device);
1.50 - l4_cap_idx_t server;
1.51 + CPM_server obj(&cpm_device);
1.52
1.53 - if (ipc_server_bind("cpm", (l4_umword_t) &obj, &server)) return 1;
1.54 + /* Bind and start the IPC server loop. */
1.55
1.56 - /* Enter the IPC server loop. */
1.57 + if (ipc_server_loop_for(CPM, &obj, "cpm"))
1.58 + return 1;
1.59
1.60 - ipc_server_loop(CPM_expected_items, &obj,
1.61 - (ipc_server_handler_type) handle_CPM);
1.62 return 0;
1.63 }