boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

hurd.h (2342B)


      1 /*
      2  * GNU Mes --- Maxwell Equations of Software
      3  * Copyright © 2019,2024 Janneke Nieuwenhuizen <janneke@gnu.org>
      4  *
      5  * This file is part of GNU Mes.
      6  *
      7  * GNU Mes is free software; you can redistribute it and/or modify it
      8  * under the terms of the GNU General Public License as published by
      9  * the Free Software Foundation; either version 3 of the License, or (at
     10  * your option) any later version.
     11  *
     12  * GNU Mes is distributed in the hope that it will be useful, but
     13  * WITHOUT ANY WARRANTY; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15  * GNU General Public License for more details.
     16  *
     17  * You should have received a copy of the GNU General Public License
     18  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
     19  */
     20 
     21 #ifndef __MES_GNU_HURD_H
     22 #define __MES_GNU_HURD_H
     23 
     24 #define _GNU_SOURCE 1
     25 #define __USE_GNU 1
     26 
     27 #include <errno.h>
     28 #include <sys/types.h>
     29 
     30 #ifndef _BITS_TYPES_H
     31 #ifndef _LOFF_T
     32 #define _LOFF_T
     33 typedef off64_t loff_t;
     34 #endif
     35 #endif
     36 
     37 #include <mach/mach_types.h>
     38 #include <mach/message.h>
     39 #include <mach/port.h>
     40 
     41 struct hurd_startup_data
     42   {
     43     int flags;
     44 
     45     mach_port_t *dtable;
     46     mach_msg_type_number_t dtable_count;
     47 
     48     char *argp;
     49     int arg_size;
     50 
     51     char *envp;
     52     int env_size;
     53 
     54     mach_port_t *portarray;
     55     mach_msg_type_number_t portarray_count;
     56 
     57     int *intarray;
     58     mach_msg_type_number_t intarray_count;
     59 
     60     vm_address_t stack_base;
     61     vm_size_t stack_count;
     62 
     63     vm_address_t phdr;
     64     vm_size_t phdr_count;
     65 
     66     vm_address_t user_entry;
     67   };
     68 
     69 #define _HURD_DTABLE_MAX 1024
     70 extern mach_port_t _hurd_dtable[_HURD_DTABLE_MAX];
     71 extern int _hurd_dtable_count;
     72 extern struct hurd_startup_data _hurd_startup_data;
     73 
     74 #define _HURD_ARGV_MAX 1000
     75 #define _HURD_ENVV_MAX 1000
     76 extern size_t __argc;
     77 extern char *__argv[_HURD_ARGV_MAX];
     78 extern char *__envv[_HURD_ENVV_MAX];
     79 
     80 mach_port_t fd_get (int filedes);
     81 error_t fd_write (mach_port_t port, void const *buffer, size_t *size, loff_t offset);
     82 error_t fd_read (mach_port_t port, void *buffer, size_t *size, loff_t offset);
     83 
     84 #include <sys/stat.h>
     85 #include <gnu/hurd-types.h>
     86 
     87 kern_return_t __dir_lookup (file_t start_dir, string_t file_name, int flags, mode_t mode, retry_type *do_retry, string_t retry_name, mach_port_t *port);
     88 mach_port_t __mach_reply_port ();
     89 
     90 #endif // __MES_GNU_HURD_H