paul@288 | 1 | /* |
paul@288 | 2 | * Notification support. |
paul@288 | 3 | * |
paul@288 | 4 | * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk> |
paul@288 | 5 | * |
paul@288 | 6 | * This program is free software; you can redistribute it and/or |
paul@288 | 7 | * modify it under the terms of the GNU General Public License as |
paul@288 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@288 | 9 | * the License, or (at your option) any later version. |
paul@288 | 10 | * |
paul@288 | 11 | * This program is distributed in the hope that it will be useful, |
paul@288 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@288 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@288 | 14 | * GNU General Public License for more details. |
paul@288 | 15 | * |
paul@288 | 16 | * You should have received a copy of the GNU General Public License |
paul@288 | 17 | * along with this program; if not, write to the Free Software |
paul@288 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@288 | 19 | * Boston, MA 02110-1301, USA |
paul@288 | 20 | */ |
paul@288 | 21 | |
paul@288 | 22 | #include "notifier_peer_endpoint.h" |
paul@288 | 23 | #include "notifier_peer_server.h" |
paul@288 | 24 | |
paul@288 | 25 | |
paul@288 | 26 | |
paul@288 | 27 | /* Notifier peer endpoint. */ |
paul@288 | 28 | |
paul@288 | 29 | NotifierPeerEndpoint::NotifierPeerEndpoint(NotificationSupport *notification, |
paul@288 | 30 | unsigned int endpoint, |
paul@288 | 31 | l4_cap_idx_t notifier) |
paul@288 | 32 | : _notification(notification), _endpoint(endpoint), _notifier(notifier) |
paul@288 | 33 | { |
paul@288 | 34 | } |
paul@288 | 35 | |
paul@288 | 36 | NotifierPeerEndpoint::~NotifierPeerEndpoint() |
paul@288 | 37 | { |
paul@288 | 38 | } |
paul@288 | 39 | |
paul@288 | 40 | /* Server methods. */ |
paul@288 | 41 | |
paul@288 | 42 | int NotifierPeerEndpoint::expected_items() |
paul@288 | 43 | { |
paul@288 | 44 | return NotifierPeer_expected_items; |
paul@288 | 45 | } |
paul@288 | 46 | |
paul@288 | 47 | ipc_server_handler_type NotifierPeerEndpoint::handler() |
paul@288 | 48 | { |
paul@288 | 49 | return (ipc_server_handler_type) handle_NotifierPeer; |
paul@288 | 50 | } |
paul@288 | 51 | |
paul@288 | 52 | /* Unsubscribe a notifier via this peer. */ |
paul@288 | 53 | |
paul@288 | 54 | long NotifierPeerEndpoint::unsubscribe() |
paul@288 | 55 | { |
paul@288 | 56 | _notification->unsubscribe(_endpoint, _notifier); |
paul@288 | 57 | return L4_EOK; |
paul@288 | 58 | } |
paul@288 | 59 | |
paul@288 | 60 | // vim: tabstop=4 expandtab shiftwidth=4 |