1 /* 2 * Process-related convenience functions and types. 3 * 4 * Copyright (C) 2023 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include <l4/sys/types.h> 25 26 #include <fsclient/file.h> 27 #include <systypes/base.h> 28 29 30 31 /* C compatibility types (defined in the implementation). */ 32 33 struct process_notifier; 34 35 typedef struct process_notifier process_notifier_t; 36 37 38 39 EXTERN_C_BEGIN 40 41 /* File access abstraction compatible with notifiable_base_t. */ 42 43 typedef struct 44 { 45 /* File object reference. */ 46 47 l4_cap_idx_t ref; 48 49 /* Notification structure. */ 50 51 notifiable_t notifiable; 52 53 } process_t; 54 55 56 57 /* Principal functions. */ 58 59 process_t *process_new(); 60 void process_init(process_t *process); 61 long process_start(process_t *process, int argc, char *argv[]); 62 63 /* Notification support. */ 64 65 notifiable_t *process_notifiable(process_t *process); 66 notify_flags_t process_notifications(process_t *process); 67 notify_values_t process_notification_values(process_t *process); 68 void process_notify_close(process_notifier_t *notifier); 69 process_notifier_t *process_notify_local(); 70 process_notifier_t *process_notify_task(); 71 long process_notify_subscribe(process_t *process, notify_flags_t flags, process_notifier_t *notifier); 72 long process_notify_unsubscribe(process_t *process, process_notifier_t *notifier); 73 long process_notify_wait_process(process_t *process, process_notifier_t *notifier); 74 long process_notify_wait_processes(process_t **process, process_notifier_t *notifier); 75 76 EXTERN_C_END 77 78 // vim: tabstop=2 expandtab shiftwidth=2