paul@483 | 1 | /* |
paul@483 | 2 | * Support for executing code in new tasks and threads. |
paul@483 | 3 | * |
paul@615 | 4 | * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk> |
paul@483 | 5 | * |
paul@483 | 6 | * This program is free software; you can redistribute it and/or |
paul@483 | 7 | * modify it under the terms of the GNU General Public License as |
paul@483 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@483 | 9 | * the License, or (at your option) any later version. |
paul@483 | 10 | * |
paul@483 | 11 | * This program is distributed in the hope that it will be useful, |
paul@483 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@483 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@483 | 14 | * GNU General Public License for more details. |
paul@483 | 15 | * |
paul@483 | 16 | * You should have received a copy of the GNU General Public License |
paul@483 | 17 | * along with this program; if not, write to the Free Software |
paul@483 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@483 | 19 | * Boston, MA 02110-1301, USA |
paul@483 | 20 | */ |
paul@483 | 21 | |
paul@483 | 22 | #pragma once |
paul@483 | 23 | |
paul@483 | 24 | #include <exec/process_creating.h> |
paul@535 | 25 | #include <resource/resource.h> |
paul@483 | 26 | |
paul@491 | 27 | #include "opener_interface.h" |
paul@483 | 28 | |
paul@483 | 29 | |
paul@483 | 30 | |
paul@483 | 31 | /* Process creator. */ |
paul@483 | 32 | |
paul@491 | 33 | class ProcessCreatorResource : public Opener, public Resource |
paul@483 | 34 | { |
paul@486 | 35 | protected: |
paul@486 | 36 | ProcessCreating _creating; |
paul@486 | 37 | |
paul@483 | 38 | public: |
paul@527 | 39 | explicit ProcessCreatorResource(const char *rm_filename, file_t *rm_file); |
paul@483 | 40 | |
paul@483 | 41 | virtual ~ProcessCreatorResource(); |
paul@483 | 42 | |
paul@483 | 43 | /* Server details. */ |
paul@483 | 44 | |
paul@483 | 45 | ipc_server_default_config_type config(); |
paul@483 | 46 | |
paul@483 | 47 | void *interface() |
paul@491 | 48 | { return static_cast<Opener *>(this); } |
paul@483 | 49 | |
paul@559 | 50 | /* Local operations. */ |
paul@483 | 51 | |
paul@559 | 52 | virtual long init_process(l4_cap_idx_t *process); |
paul@559 | 53 | |
paul@615 | 54 | virtual long start(int argc, const char *argv[], l4_cap_idx_t reader, |
paul@615 | 55 | l4_cap_idx_t writer, l4_cap_idx_t process); |
paul@491 | 56 | |
paul@491 | 57 | /* Opener interface methods. */ |
paul@491 | 58 | |
paul@491 | 59 | virtual long context(l4_cap_idx_t *context); |
paul@483 | 60 | }; |
paul@483 | 61 | |
paul@483 | 62 | /* vim: tabstop=2 expandtab shiftwidth=2 |
paul@483 | 63 | */ |