Fix warnings

* sysdeps/mach/hurd/Makefile ($(common-objpfx)errnos.d): Depend on
	libc-modules.h
	* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Remove
	unused declaration of _hurd_intr_rpc_msg_in_trap.
	* mach/mach_init.c (__mach_init): Test whether HAVE_HOST_PAGE_SIZE is
	defined instead of whether it is non-zero.
	* sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Use "+m"
	input constraint instead of both input and output constraint.  Use ecx
	clobber instead of %ecx.
	* sysdeps/mach/hurd/malloc-machine.h (mutex_init, mutex_lock,
	mutex_unlock): Use a statement expression instead of an expression list.
	* sysdeps/mach/hurd/setitimer.c (_hurd_itimer_thread_stack_size): Set
	type to vm_size_t instead of vm_address_t.
	* sysdeps/mach/hurd/fork.c (__fork): Test whether STACK_GROWTH_UP is
	defined instead of whether it is non-zero.
	* hurd/hurd/ioctl.h (_hurd_locked_install_cttyid): New declaration.
	* sysdeps/mach/hurd/setsid.c: Include <hurd/ioctl.h>.
	* sysdeps/mach/hurd/mmap.c (__mmap): Use 0 instead of NULL for
	comparisons with mapaddr.
	* nscd/nscd-client.h: Include <time.h>.
	* sysdeps/mach/hurd/dl-sysdep.c (fmh): Pass vm_offset_t dummy
	9th parameter to __vm_region instead of int.
This commit is contained in:
Samuel Thibault 2015-03-21 04:49:44 +01:00
parent d583531a9e
commit 868df0f9e9
12 changed files with 42 additions and 17 deletions

View File

@ -2,6 +2,26 @@
* sysdeps/mach/hurd/Makefile ($(common-objpfx)errnos.d): Depend on
libc-modules.h
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Remove
unused declaration of _hurd_intr_rpc_msg_in_trap.
* mach/mach_init.c (__mach_init): Test whether HAVE_HOST_PAGE_SIZE is
defined instead of whether it is non-zero.
* sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Use "+m"
input constraint instead of both input and output constraint. Use ecx
clobber instead of %ecx.
* sysdeps/mach/hurd/malloc-machine.h (mutex_init, mutex_lock,
mutex_unlock): Use a statement expression instead of an expression list.
* sysdeps/mach/hurd/setitimer.c (_hurd_itimer_thread_stack_size): Set
type to vm_size_t instead of vm_address_t.
* sysdeps/mach/hurd/fork.c (__fork): Test whether STACK_GROWTH_UP is
defined instead of whether it is non-zero.
* hurd/hurd/ioctl.h (_hurd_locked_install_cttyid): New declaration.
* sysdeps/mach/hurd/setsid.c: Include <hurd/ioctl.h>.
* sysdeps/mach/hurd/mmap.c (__mmap): Use 0 instead of NULL for
comparisons with mapaddr.
* nscd/nscd-client.h: Include <time.h>.
* sysdeps/mach/hurd/dl-sysdep.c (fmh): Pass vm_offset_t dummy
9th parameter to __vm_region instead of int.
2015-03-19 Roland McGrath <roland@hack.frob.com>

View File

@ -68,6 +68,11 @@ extern int hurd_register_ioctl_handler (int first_request, int last_request,
_HURD_HANDLE_IOCTLS_1 (handler, ioctl, ioctl, ioctl##_only)
/* Install a new CTTYID port, atomically updating the dtable appropriately.
This consumes the send right passed in. */
void _hurd_locked_install_cttyid (mach_port_t cttyid);
/* Lookup the handler for the given ioctl request. */
ioctl_handler_t _hurd_lookup_ioctl_handler (int request);

View File

@ -36,7 +36,7 @@ __mach_init (void)
__mach_task_self_ = (__mach_task_self) ();
__mig_init (0);
#if HAVE_HOST_PAGE_SIZE
#ifdef HAVE_HOST_PAGE_SIZE
if (err = __host_page_size (__mach_host_self (), &__vm_page_size))
_exit (err);
#else

View File

@ -25,6 +25,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <atomic.h>
#include <nscd-types.h>

View File

@ -96,9 +96,9 @@ static vm_size_t fmhs;
static void unfmh(void){
__vm_deallocate(__mach_task_self(),fmha,fmhs);}
static void fmh(void) {
error_t err;int x;mach_port_t p;
error_t err;int x;vm_offset_t o;mach_port_t p;
vm_address_t a=0x08000000U,max=VM_MAX_ADDRESS;
while (!(err=__vm_region(__mach_task_self(),&a,&fmhs,&x,&x,&x,&x,&p,&x))){
while (!(err=__vm_region(__mach_task_self(),&a,&fmhs,&x,&x,&x,&x,&p,&o))){
__mach_port_deallocate(__mach_task_self(),p);
if (a+fmhs>=0x80000000U){
max=a; break;}

View File

@ -507,7 +507,7 @@ __fork (void)
MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &state, &statecount))
LOSE;
#if STACK_GROWTH_UP
#ifdef STACK_GROWTH_UP
#define THREADVAR_SPACE (__hurd_threadvar_max \
* sizeof *__hurd_sightread_variables)
if (__hurd_sigthread_stack_base == 0)

View File

@ -33,9 +33,9 @@
"_hurd_intr_rpc_msg_do_trap: lcall $7, $0 # status in %0\n" \
"_hurd_intr_rpc_msg_in_trap: movl %%ecx, %%esp\n" \
"_hurd_intr_rpc_msg_sp_restored:" \
: "=a" (err), "=m" (option), "=m" (timeout) \
: "m" ((&msg)[-1]), "1" (option), "2" (timeout) \
: "%ecx"); \
: "=a" (err), "+m" (option), "+m" (timeout) \
: "m" ((&msg)[-1]) \
: "ecx"); \
err; \
})

View File

@ -35,7 +35,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
void trampoline (void);
void rpc_wait_trampoline (void);
void firewall (void);
extern const void _hurd_intr_rpc_msg_in_trap;
extern const void _hurd_intr_rpc_msg_cx_sp;
extern const void _hurd_intr_rpc_msg_sp_restored;
void *volatile sigsp;

View File

@ -33,13 +33,13 @@
#define mutex_t struct mutex
#undef mutex_init
#define mutex_init(m) (__mutex_init(m), 0)
#define mutex_init(m) ({ __mutex_init(m); 0; })
#undef mutex_lock
#define mutex_lock(m) (__mutex_lock(m), 0)
#define mutex_lock(m) ({ __mutex_lock(m); 0; })
#undef mutex_unlock
#define mutex_unlock(m) (__mutex_unlock(m), 0)
#define mutex_unlock(m) ({ __mutex_unlock(m); 0; })
#define mutex_trylock(m) (!__mutex_trylock(m))

View File

@ -48,8 +48,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
&& prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
{
/* vm_allocate has (a little) less overhead in the kernel too. */
err = __vm_allocate (__mach_task_self (), &mapaddr, len,
mapaddr == NULL);
err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0);
if (err == KERN_NO_SPACE)
{
@ -61,7 +60,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
if (!err)
err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0);
}
else if (mapaddr != NULL)
else if (mapaddr != 0)
err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1);
}
@ -145,7 +144,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
err = __vm_map (__mach_task_self (),
&mapaddr, (vm_size_t) len, (vm_address_t) 0,
mapaddr == NULL,
mapaddr == 0,
memobj, (vm_offset_t) offset,
! (flags & MAP_SHARED),
vmprot, VM_PROT_ALL,
@ -167,7 +166,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
(flags & MAP_SHARED) ? VM_INHERIT_SHARE
: VM_INHERIT_COPY);
}
else if (mapaddr != NULL)
else if (mapaddr != 0)
err = __vm_map (__mach_task_self (),
&mapaddr, (vm_size_t) len, (vm_address_t) 0,
1, memobj, (vm_offset_t) offset,

View File

@ -33,7 +33,7 @@ mach_port_t _hurd_itimer_port; /* Port the timer thread blocks on. */
thread_t _hurd_itimer_thread; /* Thread waiting for timeout. */
int _hurd_itimer_thread_suspended; /* Nonzero if that thread is suspended. */
vm_address_t _hurd_itimer_thread_stack_base; /* Base of its stack. */
vm_address_t _hurd_itimer_thread_stack_size; /* Size of its stack. */
vm_size_t _hurd_itimer_thread_stack_size; /* Size of its stack. */
struct timeval _hurd_itimer_started; /* Time the thread started waiting. */
static void

View File

@ -20,6 +20,7 @@
#include <hurd.h>
#include <hurd/port.h>
#include <hurd/fd.h>
#include <hurd/ioctl.h>
/* Create a new session with the calling process as its leader.
The process group IDs of the session and the calling process