1 /* 2 * Support for creating a new process. 3 * 4 * Copyright (C) 2022, 2023, 2024 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 <fsserver/simple_pager.h> 25 26 #include "process_creator_context_object_interface.h" 27 28 29 30 /* Forward declaration. */ 31 32 class ProcessCreatorResource; 33 34 35 36 /* A process creating context employing a simple pager to transfer process 37 details. */ 38 39 class ProcessCreatorContextResource : public SimplePager, 40 public ProcessCreatorContextObject 41 { 42 protected: 43 ProcessCreatorResource *_creator; 44 45 public: 46 explicit ProcessCreatorContextResource(ProcessCreatorResource *creator); 47 48 virtual ~ProcessCreatorContextResource(); 49 50 /* Server details. */ 51 52 ipc_server_default_config_type config(); 53 54 void *interface() 55 { return static_cast<ProcessCreatorContextObject *>(this); } 56 57 /* Process creator context interface methods. */ 58 59 virtual long start(int argc, l4_cap_idx_t reader, l4_cap_idx_t writer, 60 l4_cap_idx_t *process); 61 62 /* Pager/dataspace methods. */ 63 64 long map(offset_t offset, map_address_t hot_spot, map_flags_t flags, 65 l4_snd_fpage_t *region) 66 { return SimplePager::map(offset, hot_spot, flags, region); } 67 68 long info(ds_stats_t *stats) 69 { return SimplePager::info(stats); } 70 }; 71 72 /* vim: tabstop=2 expandtab shiftwidth=2 73 */