hurd: Fixes for upgrade to debian-hurd-20190220.img.
* include/mach/mach-init.h (__mach_host_self, __mach_task_self): Remove macro magic. (mach_host_self, mach_task_self): Remove macro magic; declare as function. * lib/mach/mach-init.c (mach_host_self, mach_task_self): New function. (mach_init): Use them. * lib/gnu/hurd-start.c (_hurd_start): Use mach_task_self (). * lib/gnu/_exit.c (_exit): Likewise.
This commit is contained in:
parent
9b0009a888
commit
7c6da0c213
|
@ -1,20 +1,28 @@
|
|||
/* Declarations and macros for the basic Mach things set at startup.
|
||||
Copyright (C) 1993-2016 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 1993-2016 Free Software Foundation, Inc.
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
/** Commentary:
|
||||
Taken from GNU C Library
|
||||
Declarations and macros for the basic Mach things set at startup.
|
||||
*/
|
||||
|
||||
#ifndef _MACH_INIT_H
|
||||
|
||||
|
@ -23,18 +31,8 @@
|
|||
#include <mach/mach_types.h>
|
||||
|
||||
/* Return the current task's task port. */
|
||||
extern mach_port_t __mach_task_self (void);
|
||||
extern mach_port_t mach_task_self (void);
|
||||
|
||||
/* This cache is initialized at startup. */
|
||||
extern mach_port_t __mach_task_self_;
|
||||
#define __mach_task_self() (__mach_task_self_ + 0) /* Not an lvalue. */
|
||||
#define mach_task_self() (__mach_task_self ())
|
||||
|
||||
/* This cache is initialized at startup. */
|
||||
extern mach_port_t __mach_host_self_;
|
||||
#define __mach_host_self() (__mach_host_self_ + 0) /* Not an lvalue. */
|
||||
#define mach_host_self() (__mach_host_self ())
|
||||
extern mach_port_t mach_host_self (void);
|
||||
|
||||
/* Kernel page size. */
|
||||
extern vm_size_t __vm_page_size;
|
||||
|
|
|
@ -33,7 +33,7 @@ void
|
|||
_exit (int status)
|
||||
{
|
||||
__proc_mark_exit (_hurd_startup_data.portarray[INIT_PORT_PROC], status, 0);
|
||||
__task_terminate (__mach_task_self ());
|
||||
__task_terminate (mach_task_self ());
|
||||
#if 0 // FIXME: this was needed?
|
||||
while (1) {* (int *) 0 = 0;}
|
||||
#else
|
||||
|
|
|
@ -48,7 +48,7 @@ _hurd_start ()
|
|||
{
|
||||
mach_port_t bootstrap;
|
||||
__mach_init ();
|
||||
__task_get_special_port (__mach_task_self (), TASK_BOOTSTRAP_PORT,
|
||||
__task_get_special_port (mach_task_self (), TASK_BOOTSTRAP_PORT,
|
||||
&bootstrap);
|
||||
__exec_startup_get_data (bootstrap, &_hurd_startup_data);
|
||||
_hurd_dtable_count = _hurd_startup_data.dtable_count;
|
||||
|
|
|
@ -1,26 +1,35 @@
|
|||
/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 1992-2016 Free Software Foundation, Inc.
|
||||
* Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
* GNU Mes is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* GNU Mes is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
/** Commentary:
|
||||
Taken from GNU C Library
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#define __USE_GNU 1
|
||||
#define __FILE_defined 1
|
||||
|
||||
#include <mach.h>
|
||||
#include <stdio.h>
|
||||
#include <mach/mach-init.h>
|
||||
//#include <mach/mig_support.h>
|
||||
#include <mach.h>
|
||||
#include <unistd.h>
|
||||
|
||||
mach_port_t __mach_task_self_;
|
||||
|
@ -32,21 +41,35 @@ __mach_init (void)
|
|||
{
|
||||
kern_return_t err;
|
||||
|
||||
__mach_task_self_ = (__mach_task_self) ();
|
||||
__mach_host_self_ = (__mach_host_self) ();
|
||||
#if 0
|
||||
__mig_init (0);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_HOST_PAGE_SIZE
|
||||
if (err = __host_page_size (__mach_host_self (), &__vm_page_size))
|
||||
if (err = __host_page_size (mach_host_self (), &__vm_page_size))
|
||||
_exit (err);
|
||||
#else
|
||||
{
|
||||
vm_statistics_data_t stats;
|
||||
if (err = __vm_statistics (__mach_task_self (), &stats))
|
||||
if (err = __vm_statistics (mach_task_self (), &stats))
|
||||
_exit (err);
|
||||
__vm_page_size = stats.pagesize;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
extern mach_port_t __mach_host_self (void);
|
||||
|
||||
mach_port_t
|
||||
mach_host_self (void)
|
||||
{
|
||||
if (!__mach_host_self_)
|
||||
__mach_host_self_ = __mach_host_self ();
|
||||
return __mach_host_self_;
|
||||
}
|
||||
|
||||
extern mach_port_t __mach_task_self (void);
|
||||
|
||||
mach_port_t
|
||||
mach_task_self (void)
|
||||
{
|
||||
if (!__mach_task_self_)
|
||||
__mach_task_self_ = __mach_task_self ();
|
||||
return __mach_task_self_;
|
||||
}
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Taken from GNU C Library
|
||||
* Routines for dealing with '\0' separated arg vectors.
|
||||
* Written by Miles Bader <miles@gnu.ai.mit.edu>
|
||||
/** Commentary:
|
||||
Taken from GNU C Library
|
||||
Routines for dealing with '\0' separated arg vectors.
|
||||
Written by Miles Bader <miles@gnu.org>
|
||||
*/
|
||||
|
||||
#include <argz.h>
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Taken from GNU C Library
|
||||
* Routines for dealing with '\0' separated arg vectors.
|
||||
* Written by Miles Bader <miles@gnu.org>
|
||||
/** Commentary:
|
||||
Taken from GNU C Library
|
||||
Routines for dealing with '\0' separated arg vectors.
|
||||
Written by Miles Bader <miles@gnu.org>
|
||||
*/
|
||||
|
||||
#include <argz.h>
|
||||
|
|
Loading…
Reference in a new issue