Landfall

Annotated pkg/devices/keypad/src/server/keypad-run.cc

153:929b5f0a63e4
16 months ago Paul Boddie Converted the remaining code to use libipc and generated IPC components. idl4re-libipc-libsystypes
paul@153 1
/*
paul@153 2
 * Common keypad server functionality.
paul@153 3
 *
paul@153 4
 * Copyright (C) 2023 Paul Boddie <paul@boddie.org.uk>
paul@153 5
 *
paul@153 6
 * This program is free software; you can redistribute it and/or
paul@153 7
 * modify it under the terms of the GNU General Public License as
paul@153 8
 * published by the Free Software Foundation; either version 2 of
paul@153 9
 * the License, or (at your option) any later version.
paul@153 10
 *
paul@153 11
 * This program is distributed in the hope that it will be useful,
paul@153 12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@153 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
paul@153 14
 * GNU General Public License for more details.
paul@153 15
 *
paul@153 16
 * You should have received a copy of the GNU General Public License
paul@153 17
 * along with this program; if not, write to the Free Software
paul@153 18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
paul@153 19
 * Boston, MA  02110-1301, USA
paul@153 20
 */
paul@153 21
paul@153 22
/* Common server functionality. */
paul@153 23
paul@153 24
#include "keypad-server.h"
paul@153 25
paul@153 26
/* Server infrastructure. */
paul@153 27
paul@153 28
#include <ipc/server.h>
paul@153 29
#include "keypad_server.h"
paul@153 30
paul@153 31
#include "keypad-run.h"
paul@153 32
paul@153 33
paul@153 34
paul@153 35
/* Main program. */
paul@153 36
paul@153 37
long run(l4re_ds_t mem)
paul@153 38
{
paul@153 39
  /* Initialise and register a server object. */
paul@153 40
paul@153 41
  Keypad_server obj(mem);
paul@153 42
paul@153 43
  /* Bind and start the IPC server loop. */
paul@153 44
paul@153 45
  if (ipc_server_loop_for(Keypad, &obj, "keypad"))
paul@153 46
    return 1;
paul@153 47
paul@153 48
  return 0;
paul@153 49
}