[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnumach] 01/02: Imported Upstream version 1.4+git20150709
From: |
Samuel Thibault |
Subject: |
[gnumach] 01/02: Imported Upstream version 1.4+git20150709 |
Date: |
Thu, 09 Jul 2015 22:52:36 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch master
in repository gnumach.
commit 5d163e374a73559312a46d48956d164115ab7c99
Author: Samuel Thibault <address@hidden>
Date: Thu Jul 9 12:23:34 2015 +0000
Imported Upstream version 1.4+git20150709
---
ChangeLog | 45 +++++++
configure | 20 +--
doc/mach.info | 240 ++++++++++++++++-----------------
doc/mach.info-1 | 32 ++---
doc/mach.info-2 | 6 +-
doc/mach.texi | 13 +-
doc/stamp-vti | 8 +-
doc/version.texi | 8 +-
include/mach/mach_host.defs | 2 +-
linux/dev/include/asm-i386/string.h | 36 ++---
linux/dev/include/linux/fs.h | 2 +-
linux/src/include/asm-i386/bitops.h | 22 +--
linux/src/include/asm-i386/io.h | 12 +-
linux/src/include/asm-i386/segment.h | 8 ++
linux/src/include/asm-i386/semaphore.h | 6 +-
linux/src/include/linux/string.h | 8 ++
version.m4 | 2 +-
vm/vm_map.c | 15 +++
vm/vm_map.h | 1 +
vm/vm_user.c | 27 +++-
20 files changed, 306 insertions(+), 207 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 10f18ee..73aafea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,48 @@
+2015-07-09 Samuel Thibault <address@hidden>
+
+ Allow non-privileged tasks to wire 64KiB task memory
+ * doc/mach.texi (vm_wire): Document that the host port does not have to
be
+ privileged.
+ * include/mach/mach_hosts.defs (vm_wire): Use mach_port_t instead of
+ host_priv_t.
+ * vm/vm_map.h (vm_map): Add user_wired field.
+ * vm/vm_map.c (vm_map_setup): Initialize user_wired field to 0.
+ (vm_map_pageable_common, vm_map_entry_delete, vm_map_copy_overwrite,
+ vm_map_copyout_page_list, vm_map_copyin_page_list): When switching
+ user_wired_count field of entry between 0 and non-0, accumulate the
+ corresponding size into the user_wired field of map.
+ * vm/vm_user.c (vm_wire): Turn host parameter into port parameter, and
+ inline a version of convert_port_to_host_priv which records whether the
host
+ port is privileged or not. When it is not privileged, check whether
+ the additional amount to user_wired will overcome 64KiB.
+
+2015-07-07 Samuel Thibault <address@hidden>
+
+ Fix build with -O0
+ * linux/src/include/linux/string.h (strcpy, strncpy, strcat, strncat,
+ strchr, strrchr, strlen, strnlen, strcmp, strncmp, memmove,
+ memscan): Comment out extern declarations.
+ * linux/dev/include/asm-i386/string.h (strcpy, strncpy, strcat, strncat,
+ strcmp, strncmp, strchr, strrchr, strlen, __memcpy, __constant_memcpy,
+ memmove, memchr, __memset_generic, __constant_c_memset, strnlen,
+ __constant_c_and_count_memset, memscan): Turn extern inline into static
+ inline.
+ * linux/dev/include/linux/fs.h (mark_buffer_uptodate): Likewise.
+ * linux/src/include/asm-i386/bitops.h (set_bit, clear_bit, change_bit,
+ test_and_set_bit, test_and_clear_bit, test_and_change_bit, test_bit,
+ find_first_zero_bit, find_next_zero_bit, ffz, ffs): Likewise.
+ * linux/src/include/asm-i386/io.h (virt_to_phys, phys_to_virt, __out##s,
+ __in##s, ins##s, outs##s): Likewise.
+ * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up):
+ Likewise.
+ * linux/src/include/asm-i386/segment.h [!__OPTIMIZE]: Emit an ud2
instruction
+ instead of an undefined reference.
+
+2015-07-05 Samuel Thibault <address@hidden>
+
+ Add missing distributed file
+ * Makefrag.am (EXTRA_DIST): Add ipc/notify.defs.
+
2015-06-30 Justus Winter <address@hidden>
Fix re-configuring out-of-tree builds
diff --git a/configure b/configure
index a0c1fb2..53273ea 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU Mach 1.4+git20150704.
+# Generated by GNU Autoconf 2.69 for GNU Mach 1.4+git20150709.
#
# Report bugs to <address@hidden>.
#
@@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GNU Mach'
PACKAGE_TARNAME='gnumach'
-PACKAGE_VERSION='1.4+git20150704'
-PACKAGE_STRING='GNU Mach 1.4+git20150704'
+PACKAGE_VERSION='1.4+git20150709'
+PACKAGE_STRING='GNU Mach 1.4+git20150709'
PACKAGE_BUGREPORT='address@hidden'
PACKAGE_URL=''
@@ -1584,7 +1584,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GNU Mach 1.4+git20150704 to adapt to many kinds of
systems.
+\`configure' configures GNU Mach 1.4+git20150709 to adapt to many kinds of
systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1654,7 +1654,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GNU Mach 1.4+git20150704:";;
+ short | recursive ) echo "Configuration of GNU Mach 1.4+git20150709:";;
esac
cat <<\_ACEOF
@@ -2002,7 +2002,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GNU Mach configure 1.4+git20150704
+GNU Mach configure 1.4+git20150709
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2094,7 +2094,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GNU Mach $as_me 1.4+git20150704, which was
+It was created by GNU Mach $as_me 1.4+git20150709, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2960,7 +2960,7 @@ fi
# Define the identity of the package.
PACKAGE='gnumach'
- VERSION='1.4+git20150704'
+ VERSION='1.4+git20150709'
# Some tools Automake needs.
@@ -12116,7 +12116,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GNU Mach $as_me 1.4+git20150704, which was
+This file was extended by GNU Mach $as_me 1.4+git20150709, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12187,7 +12187,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GNU Mach config.status 1.4+git20150704
+GNU Mach config.status 1.4+git20150709
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/doc/mach.info b/doc/mach.info
index 1a5560b..ea89d82 100644
--- a/doc/mach.info
+++ b/doc/mach.info
@@ -2,8 +2,8 @@ This is mach.info, produced by makeinfo version 5.2 from
mach.texi.
This file documents the GNU Mach microkernel.
- This is edition 0.4, last updated on 11 March 2015, of 'The GNU Mach
-Reference Manual', for version 1.4+git20150704.
+ This is edition 0.4, last updated on 9 July 2015, of 'The GNU Mach
+Reference Manual', for version 1.4+git20150709.
Copyright (C) 2001, 2002, 2006, 2007, 2008 Free Software Foundation,
Inc.
@@ -39,126 +39,126 @@ END-INFO-DIR-ENTRY
Indirect:
-mach.info-1: 1639
-mach.info-2: 302538
+mach.info-1: 1637
+mach.info-2: 302552
Tag Table:
(Indirect)
-Node: Top1639
-Node: Introduction11276
-Node: Audience12107
-Node: Features13142
-Node: Overview14969
-Node: History16162
-Node: Installing16307
-Node: Binary Distributions17532
-Node: Compilation18340
-Node: Configuration19573
-Node: Cross-Compilation35984
-Node: Bootstrap36765
-Ref: Bootstrap-Footnote-137208
-Node: Bootloader37445
-Ref: Bootloader-Footnote-138725
-Node: Modules38811
-Node: Inter Process Communication39638
-Node: Major Concepts40261
-Node: Messaging Interface44066
-Node: Mach Message Call44796
-Node: Message Format48111
-Node: Exchanging Port Rights59303
-Ref: Exchanging Port Rights-Footnote-164865
-Node: Memory65037
-Ref: Memory-Footnote-168131
-Node: Message Send68473
-Ref: Message Send-Footnote-175495
-Node: Message Receive75778
-Ref: Message Receive-Footnote-185430
-Node: Atomicity85711
-Node: Port Manipulation Interface88485
-Node: Port Creation90040
-Node: Port Destruction94829
-Node: Port Names97972
-Node: Port Rights102219
-Node: Ports and other Tasks106008
-Node: Receive Rights110101
-Node: Port Sets117032
-Node: Request Notifications119435
-Node: Inherited Ports124239
-Node: Virtual Memory Interface127923
-Node: Memory Allocation129176
-Node: Memory Deallocation131701
-Node: Data Transfer133165
-Node: Memory Attributes136691
-Node: Mapping Memory Objects146110
-Node: Memory Statistics149419
-Node: External Memory Management150993
-Node: Memory Object Server151698
-Node: Memory Object Creation154407
-Node: Memory Object Termination158413
-Node: Memory Objects and Data161352
-Node: Memory Object Locking178498
-Node: Memory Object Attributes184393
-Node: Default Memory Manager190230
-Node: Threads and Tasks195952
-Node: Thread Interface196289
-Node: Thread Creation197285
-Node: Thread Termination198402
-Node: Thread Information198873
-Node: Thread Settings204972
-Node: Thread Execution206206
-Node: Scheduling213499
-Node: Thread Priority213854
-Node: Hand-Off Scheduling216488
-Node: Scheduling Policy221613
-Node: Thread Special Ports222945
-Node: Exceptions225391
-Node: Task Interface226261
-Node: Task Creation227273
-Node: Task Termination228608
-Node: Task Information229210
-Node: Task Execution236112
-Node: Task Special Ports240525
-Node: Syscall Emulation244379
-Node: Profiling245610
-Node: Host Interface249373
-Node: Host Ports250358
-Node: Host Information252431
-Node: Host Time257814
-Node: Host Reboot260481
-Node: Processors and Processor Sets261033
-Node: Processor Set Interface262011
-Node: Processor Set Ports262778
-Node: Processor Set Access263608
-Node: Processor Set Creation265868
-Node: Processor Set Destruction266895
-Node: Tasks and Threads on Sets267816
-Node: Processor Set Priority272983
-Node: Processor Set Policy274273
-Node: Processor Set Info275887
-Node: Processor Interface279700
-Node: Hosted Processors280425
-Node: Processor Control281416
-Node: Processors and Sets282882
-Node: Processor Info284760
-Node: Device Interface287502
-Node: Device Reply Server289117
-Node: Device Open290409
-Node: Device Close292532
-Node: Device Read293111
-Node: Device Write296030
-Node: Device Map298835
-Node: Device Status299726
-Node: Device Filter302538
-Node: Kernel Debugger308285
-Node: Operation309012
-Node: Commands311989
-Node: Variables325774
-Node: Expressions327162
-Node: Copying328511
-Node: Documentation License347740
-Node: GNU Free Documentation License348329
-Node: CMU License370728
-Node: Concept Index371963
-Node: Function and Data Index375809
+Node: Top1637
+Node: Introduction11272
+Node: Audience12103
+Node: Features13138
+Node: Overview14965
+Node: History16158
+Node: Installing16303
+Node: Binary Distributions17528
+Node: Compilation18336
+Node: Configuration19569
+Node: Cross-Compilation35980
+Node: Bootstrap36761
+Ref: Bootstrap-Footnote-137204
+Node: Bootloader37441
+Ref: Bootloader-Footnote-138721
+Node: Modules38807
+Node: Inter Process Communication39634
+Node: Major Concepts40257
+Node: Messaging Interface44062
+Node: Mach Message Call44792
+Node: Message Format48107
+Node: Exchanging Port Rights59299
+Ref: Exchanging Port Rights-Footnote-164861
+Node: Memory65033
+Ref: Memory-Footnote-168127
+Node: Message Send68469
+Ref: Message Send-Footnote-175491
+Node: Message Receive75774
+Ref: Message Receive-Footnote-185426
+Node: Atomicity85707
+Node: Port Manipulation Interface88481
+Node: Port Creation90036
+Node: Port Destruction94825
+Node: Port Names97968
+Node: Port Rights102215
+Node: Ports and other Tasks106004
+Node: Receive Rights110097
+Node: Port Sets117028
+Node: Request Notifications119431
+Node: Inherited Ports124235
+Node: Virtual Memory Interface127919
+Node: Memory Allocation129172
+Node: Memory Deallocation131697
+Node: Data Transfer133161
+Node: Memory Attributes136687
+Node: Mapping Memory Objects146126
+Node: Memory Statistics149435
+Node: External Memory Management151009
+Node: Memory Object Server151714
+Node: Memory Object Creation154423
+Node: Memory Object Termination158429
+Node: Memory Objects and Data161368
+Node: Memory Object Locking178514
+Node: Memory Object Attributes184409
+Node: Default Memory Manager190246
+Node: Threads and Tasks195968
+Node: Thread Interface196305
+Node: Thread Creation197301
+Node: Thread Termination198418
+Node: Thread Information198889
+Node: Thread Settings204988
+Node: Thread Execution206222
+Node: Scheduling213515
+Node: Thread Priority213870
+Node: Hand-Off Scheduling216504
+Node: Scheduling Policy221629
+Node: Thread Special Ports222961
+Node: Exceptions225407
+Node: Task Interface226277
+Node: Task Creation227289
+Node: Task Termination228624
+Node: Task Information229226
+Node: Task Execution236128
+Node: Task Special Ports240541
+Node: Syscall Emulation244395
+Node: Profiling245626
+Node: Host Interface249389
+Node: Host Ports250374
+Node: Host Information252447
+Node: Host Time257830
+Node: Host Reboot260497
+Node: Processors and Processor Sets261049
+Node: Processor Set Interface262027
+Node: Processor Set Ports262794
+Node: Processor Set Access263624
+Node: Processor Set Creation265884
+Node: Processor Set Destruction266911
+Node: Tasks and Threads on Sets267832
+Node: Processor Set Priority272999
+Node: Processor Set Policy274289
+Node: Processor Set Info275903
+Node: Processor Interface279716
+Node: Hosted Processors280441
+Node: Processor Control281432
+Node: Processors and Sets282898
+Node: Processor Info284776
+Node: Device Interface287518
+Node: Device Reply Server289133
+Node: Device Open290425
+Node: Device Close292548
+Node: Device Read293127
+Node: Device Write296046
+Node: Device Map298851
+Node: Device Status299742
+Node: Device Filter302552
+Node: Kernel Debugger308299
+Node: Operation309026
+Node: Commands312003
+Node: Variables325788
+Node: Expressions327176
+Node: Copying328525
+Node: Documentation License347754
+Node: GNU Free Documentation License348343
+Node: CMU License370742
+Node: Concept Index371977
+Node: Function and Data Index375823
End Tag Table
diff --git a/doc/mach.info-1 b/doc/mach.info-1
index c689156..16023a7 100644
--- a/doc/mach.info-1
+++ b/doc/mach.info-1
@@ -2,8 +2,8 @@ This is mach.info, produced by makeinfo version 5.2 from
mach.texi.
This file documents the GNU Mach microkernel.
- This is edition 0.4, last updated on 11 March 2015, of 'The GNU Mach
-Reference Manual', for version 1.4+git20150704.
+ This is edition 0.4, last updated on 9 July 2015, of 'The GNU Mach
+Reference Manual', for version 1.4+git20150709.
Copyright (C) 2001, 2002, 2006, 2007, 2008 Free Software Foundation,
Inc.
@@ -45,8 +45,8 @@ Main Menu
This file documents the GNU Mach microkernel.
- This is edition 0.4, last updated on 11 March 2015, of 'The GNU Mach
-Reference Manual', for version 1.4+git20150704.
+ This is edition 0.4, last updated on 9 July 2015, of 'The GNU Mach
+Reference Manual', for version 1.4+git20150709.
Copyright (C) 2001, 2002, 2006, 2007, 2008 Free Software Foundation,
Inc.
@@ -3216,16 +3216,16 @@ File: mach.info, Node: Memory Attributes, Next:
Mapping Memory Objects, Prev:
successfully set and 'KERN_INVALID_ADDRESS' if an invalid or
non-allocated address was specified.
- -- Function: kern_return_t vm_wire (host_priv_t HOST_PRIV,
- vm_task_t TARGET_TASK, vm_address_t ADDRESS, vm_size_t SIZE,
- vm_prot_t ACCESS)
- The function 'vm_wire' allows privileged applications to control
- memory pageability. HOST_PRIV is the privileged host port for the
- host on which TARGET_TASK resides. ADDRESS is the starting
- address, which will be rounded down to a page boundary. SIZE is
- the size in bytes of the region for which protection is to change,
- and will be rounded up to give a page boundary. ACCESS specifies
- the types of accesses that must not cause page faults.
+ -- Function: kern_return_t vm_wire (host_t HOST, vm_task_t TARGET_TASK,
+ vm_address_t ADDRESS, vm_size_t SIZE, vm_prot_t ACCESS)
+ The function 'vm_wire' allows applications to control memory
+ pageability. HOST is the host port for the host on which
+ TARGET_TASK resides. ADDRESS is the starting address, which will
+ be rounded down to a page boundary. SIZE is the size in bytes of
+ the region for which protection is to change, and will be rounded
+ up to give a page boundary. ACCESS specifies the types of accesses
+ that must not cause page faults. If the host port is not
+ privileged, the amount of memory is limited per task.
The semantics of a successful 'vm_wire' operation are that memory
in the specified range will not cause page faults for any accesses
@@ -3234,7 +3234,7 @@ File: mach.info, Node: Memory Attributes, Next: Mapping
Memory Objects, Prev:
special case is that 'VM_PROT_NONE' makes the memory pageable.
The function returns 'KERN_SUCCESS' if the call succeeded,
- 'KERN_INVALID_HOST' if HOST_PRIV was not the privileged host port,
+ 'KERN_INVALID_HOST' if HOST was not a valid host port,
'KERN_INVALID_TASK' if TASK was not a valid task,
'KERN_INVALID_VALUE' if ACCESS specified an invalid access mode,
'KERN_FAILURE' if some memory in the specified range is not present
@@ -3242,7 +3242,7 @@ File: mach.info, Node: Memory Attributes, Next: Mapping
Memory Objects, Prev:
'KERN_INVALID_ARGUMENT' if unwiring (ACCESS is 'VM_PROT_NONE') and
the memory is not already wired.
- The 'vm_wire' call is actually an RPC to HOST_PRIV, normally a send
+ The 'vm_wire' call is actually an RPC to HOST, normally a send
right for a privileged host port, but potentially any send right.
In addition to the normal diagnostic return codes from the call's
server (normally the kernel), the call may return 'mach_msg' return
diff --git a/doc/mach.info-2 b/doc/mach.info-2
index 6f3b233..bdb8718 100644
--- a/doc/mach.info-2
+++ b/doc/mach.info-2
@@ -2,8 +2,8 @@ This is mach.info, produced by makeinfo version 5.2 from
mach.texi.
This file documents the GNU Mach microkernel.
- This is edition 0.4, last updated on 11 March 2015, of 'The GNU Mach
-Reference Manual', for version 1.4+git20150704.
+ This is edition 0.4, last updated on 9 July 2015, of 'The GNU Mach
+Reference Manual', for version 1.4+git20150709.
Copyright (C) 2001, 2002, 2006, 2007, 2008 Free Software Foundation,
Inc.
@@ -1940,7 +1940,7 @@ Function and Data Index
* vm_copy: Data Transfer. (line 50)
* vm_deallocate: Memory Deallocation. (line 6)
* vm_inherit: Memory Attributes. (line 68)
-* vm_machine_attribute: Memory Attributes. (line 130)
+* vm_machine_attribute: Memory Attributes. (line 131)
* vm_map: Mapping Memory Objects.
(line 6)
* vm_protect: Memory Attributes. (line 34)
diff --git a/doc/mach.texi b/doc/mach.texi
index 59872c9..6fc79f7 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -3241,14 +3241,15 @@ successfully set and @code{KERN_INVALID_ADDRESS} if an
invalid or
non-allocated address was specified.
@end deftypefun
address@hidden kern_return_t vm_wire (@w{host_priv_t @var{host_priv}},
@w{vm_task_t @var{target_task}}, @w{vm_address_t @var{address}}, @w{vm_size_t
@var{size}}, @w{vm_prot_t @var{access}})
-The function @code{vm_wire} allows privileged applications to control
-memory pageability. @var{host_priv} is the privileged host port for the
address@hidden kern_return_t vm_wire (@w{host_t @var{host}}, @w{vm_task_t
@var{target_task}}, @w{vm_address_t @var{address}}, @w{vm_size_t @var{size}},
@w{vm_prot_t @var{access}})
+The function @code{vm_wire} allows applications to control
+memory pageability. @var{host} is the host port for the
host on which @var{target_task} resides. @var{address} is the starting
address, which will be rounded down to a page boundary. @var{size} is
the size in bytes of the region for which protection is to change, and
will be rounded up to give a page boundary. @var{access} specifies the
-types of accesses that must not cause page faults.
+types of accesses that must not cause page faults. If the host port is
+not privileged, the amount of memory is limited per task.
The semantics of a successful @code{vm_wire} operation are that memory
in the specified range will not cause page faults for any accesses
@@ -3257,7 +3258,7 @@ access argument of @code{VM_PROT_READ | VM_PROT_WRITE}.
A special case
is that @code{VM_PROT_NONE} makes the memory pageable.
The function returns @code{KERN_SUCCESS} if the call succeeded,
address@hidden if @var{host_priv} was not the privileged host
address@hidden if @var{host} was not a valid host
port, @code{KERN_INVALID_TASK} if @var{task} was not a valid task,
@code{KERN_INVALID_VALUE} if @var{access} specified an invalid access
mode, @code{KERN_FAILURE} if some memory in the specified range is not
@@ -3265,7 +3266,7 @@ present or has an inappropriate protection value, and
@code{KERN_INVALID_ARGUMENT} if unwiring (@var{access} is
@code{VM_PROT_NONE}) and the memory is not already wired.
-The @code{vm_wire} call is actually an RPC to @var{host_priv}, normally
+The @code{vm_wire} call is actually an RPC to @var{host}, normally
a send right for a privileged host port, but potentially any send right.
In addition to the normal diagnostic return codes from the call's server
(normally the kernel), the call may return @code{mach_msg} return codes.
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 5bdb050..7f60e1a 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1,4 +1,4 @@
address@hidden UPDATED 11 March 2015
address@hidden UPDATED-MONTH March 2015
address@hidden EDITION 1.4+git20150704
address@hidden VERSION 1.4+git20150704
address@hidden UPDATED 9 July 2015
address@hidden UPDATED-MONTH July 2015
address@hidden EDITION 1.4+git20150709
address@hidden VERSION 1.4+git20150709
diff --git a/doc/version.texi b/doc/version.texi
index 5bdb050..7f60e1a 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
address@hidden UPDATED 11 March 2015
address@hidden UPDATED-MONTH March 2015
address@hidden EDITION 1.4+git20150704
address@hidden VERSION 1.4+git20150704
address@hidden UPDATED 9 July 2015
address@hidden UPDATED-MONTH July 2015
address@hidden EDITION 1.4+git20150709
address@hidden VERSION 1.4+git20150709
diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs
index 6699a50..28439a0 100644
--- a/include/mach/mach_host.defs
+++ b/include/mach/mach_host.defs
@@ -296,7 +296,7 @@ routine host_reboot(
* [ To unwire the pages, specify VM_PROT_NONE. ]
*/
routine vm_wire(
- host_priv : host_priv_t;
+ host : mach_port_t;
task : vm_task_t;
address : vm_address_t;
size : vm_size_t;
diff --git a/linux/dev/include/asm-i386/string.h
b/linux/dev/include/asm-i386/string.h
index bdb7545..f41ca5c 100644
--- a/linux/dev/include/asm-i386/string.h
+++ b/linux/dev/include/asm-i386/string.h
@@ -28,7 +28,7 @@
*/
#define __HAVE_ARCH_STRCPY
-extern inline char * strcpy(char * dest,const char *src)
+static inline char * strcpy(char * dest,const char *src)
{
int d0, d1, d2;
__asm__ __volatile__(
@@ -43,7 +43,7 @@ return dest;
}
#define __HAVE_ARCH_STRNCPY
-extern inline char * strncpy(char * dest,const char *src,size_t count)
+static inline char * strncpy(char * dest,const char *src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
@@ -63,7 +63,7 @@ return dest;
}
#define __HAVE_ARCH_STRCAT
-extern inline char * strcat(char * dest,const char * src)
+static inline char * strcat(char * dest,const char * src)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
@@ -81,7 +81,7 @@ return dest;
}
#define __HAVE_ARCH_STRNCAT
-extern inline char * strncat(char * dest,const char * src,size_t count)
+static inline char * strncat(char * dest,const char * src,size_t count)
{
int d0, d1, d2, d3;
__asm__ __volatile__(
@@ -105,7 +105,7 @@ return dest;
}
#define __HAVE_ARCH_STRCMP
-extern inline int strcmp(const char * cs,const char * ct)
+static inline int strcmp(const char * cs,const char * ct)
{
int d0, d1;
register int __res;
@@ -127,7 +127,7 @@ return __res;
}
#define __HAVE_ARCH_STRNCMP
-extern inline int strncmp(const char * cs,const char * ct,size_t count)
+static inline int strncmp(const char * cs,const char * ct,size_t count)
{
register int __res;
int d0, d1, d2;
@@ -151,7 +151,7 @@ return __res;
}
#define __HAVE_ARCH_STRCHR
-extern inline char * strchr(const char * s, int c)
+static inline char * strchr(const char * s, int c)
{
int d0;
register char * __res;
@@ -171,7 +171,7 @@ return __res;
}
#define __HAVE_ARCH_STRRCHR
-extern inline char * strrchr(const char * s, int c)
+static inline char * strrchr(const char * s, int c)
{
int d0, d1;
register char * __res;
@@ -189,7 +189,7 @@ return __res;
}
#define __HAVE_ARCH_STRLEN
-extern inline size_t strlen(const char * s)
+static inline size_t strlen(const char * s)
{
int d0;
register int __res;
@@ -203,7 +203,7 @@ __asm__ __volatile__(
return __res;
}
-extern inline void * __memcpy(void * to, const void * from, size_t n)
+static inline void * __memcpy(void * to, const void * from, size_t n)
{
int d0, d1, d2;
__asm__ __volatile__(
@@ -226,7 +226,7 @@ return (to);
* This looks horribly ugly, but the compiler can optimize it totally,
* as the count is constant.
*/
-extern inline void * __constant_memcpy(void * to, const void * from, size_t n)
+static inline void * __constant_memcpy(void * to, const void * from, size_t n)
{
switch (n) {
case 0:
@@ -299,7 +299,7 @@ __asm__ __volatile__( \
__memcpy((t),(f),(n)))
#define __HAVE_ARCH_MEMMOVE
-extern inline void * memmove(void * dest,const void * src, size_t n)
+static inline void * memmove(void * dest,const void * src, size_t n)
{
int d0, d1, d2;
if (dest<src)
@@ -327,7 +327,7 @@ return dest;
#define memcmp __builtin_memcmp
#define __HAVE_ARCH_MEMCHR
-extern inline void * memchr(const void * cs,int c,size_t count)
+static inline void * memchr(const void * cs,int c,size_t count)
{
int d0;
register void * __res;
@@ -344,7 +344,7 @@ __asm__ __volatile__(
return __res;
}
-extern inline void * __memset_generic(void * s, char c,size_t count)
+static inline void * __memset_generic(void * s, char c,size_t count)
{
int d0, d1;
__asm__ __volatile__(
@@ -365,7 +365,7 @@ return s;
* things 32 bits at a time even when we don't know the size of the
* area at compile-time..
*/
-extern inline void * __constant_c_memset(void * s, unsigned long c, size_t
count)
+static inline void * __constant_c_memset(void * s, unsigned long c, size_t
count)
{
int d0, d1;
__asm__ __volatile__(
@@ -386,7 +386,7 @@ return (s);
/* Added by Gertjan van Wingerde to make minix and sysv module work */
#define __HAVE_ARCH_STRNLEN
-extern inline size_t strnlen(const char * s, size_t count)
+static inline size_t strnlen(const char * s, size_t count)
{
int d0;
register int __res;
@@ -410,7 +410,7 @@ return __res;
* This looks horribly ugly, but the compiler can optimize it totally,
* as we by now know that both pattern and count is constant..
*/
-extern inline void * __constant_c_and_count_memset(void * s, unsigned long
pattern, size_t count)
+static inline void * __constant_c_and_count_memset(void * s, unsigned long
pattern, size_t count)
{
switch (count) {
case 0:
@@ -469,7 +469,7 @@ __asm__ __volatile__("cld\n\t" \
* find the first occurrence of byte 'c', or 1 past the area if none
*/
#define __HAVE_ARCH_MEMSCAN
-extern inline void * memscan(void * addr, int c, size_t size)
+static inline void * memscan(void * addr, int c, size_t size)
{
if (!size)
return addr;
diff --git a/linux/dev/include/linux/fs.h b/linux/dev/include/linux/fs.h
index 37f7173..a2f9383 100644
--- a/linux/dev/include/linux/fs.h
+++ b/linux/dev/include/linux/fs.h
@@ -638,7 +638,7 @@ extern int nr_buffer_heads;
#define NR_LIST 4
#ifdef MACH
-extern inline void
+static inline void
mark_buffer_uptodate (struct buffer_head *bh, int on)
{
if (on)
diff --git a/linux/src/include/asm-i386/bitops.h
b/linux/src/include/asm-i386/bitops.h
index 0bfa9fd..e2a4c14 100644
--- a/linux/src/include/asm-i386/bitops.h
+++ b/linux/src/include/asm-i386/bitops.h
@@ -28,7 +28,7 @@ struct __dummy { unsigned long a[100]; };
#define ADDR (*(struct __dummy *) addr)
#define CONST_ADDR (*(const struct __dummy *) addr)
-extern __inline__ int set_bit(int nr, SMPVOL void * addr)
+static __inline__ int set_bit(int nr, SMPVOL void * addr)
{
int oldbit;
@@ -39,7 +39,7 @@ extern __inline__ int set_bit(int nr, SMPVOL void * addr)
return oldbit;
}
-extern __inline__ int clear_bit(int nr, SMPVOL void * addr)
+static __inline__ int clear_bit(int nr, SMPVOL void * addr)
{
int oldbit;
@@ -50,7 +50,7 @@ extern __inline__ int clear_bit(int nr, SMPVOL void * addr)
return oldbit;
}
-extern __inline__ int change_bit(int nr, SMPVOL void * addr)
+static __inline__ int change_bit(int nr, SMPVOL void * addr)
{
int oldbit;
@@ -61,7 +61,7 @@ extern __inline__ int change_bit(int nr, SMPVOL void * addr)
return oldbit;
}
-extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
+static __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
@@ -72,7 +72,7 @@ extern __inline__ int test_and_set_bit(int nr, volatile void
* addr)
return oldbit;
}
-extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int oldbit;
@@ -83,7 +83,7 @@ extern __inline__ int test_and_clear_bit(int nr, volatile
void * addr)
return oldbit;
}
-extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
+static __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int oldbit;
@@ -98,7 +98,7 @@ extern __inline__ int test_and_change_bit(int nr, volatile
void * addr)
/*
* This routine doesn't need to be atomic.
*/
-extern __inline__ int test_bit(int nr, const SMPVOL void * addr)
+static __inline__ int test_bit(int nr, const SMPVOL void * addr)
{
return ((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5]))
!= 0;
}
@@ -106,7 +106,7 @@ extern __inline__ int test_bit(int nr, const SMPVOL void *
addr)
/*
* Find-bit routines..
*/
-extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
+static __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
int d0, d1, d2;
int res;
@@ -129,7 +129,7 @@ extern __inline__ int find_first_zero_bit(void * addr,
unsigned size)
return res;
}
-extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
+static __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
@@ -160,7 +160,7 @@ extern __inline__ int find_next_zero_bit (void * addr, int
size, int offset)
* ffz = Find First Zero in word. Undefined if no zero exists,
* so code should check against ~0UL first..
*/
-extern __inline__ unsigned long ffz(unsigned long word)
+static __inline__ unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
@@ -176,7 +176,7 @@ extern __inline__ unsigned long ffz(unsigned long word)
* differs in spirit from the above ffz (man ffs).
*/
-extern __inline__ int ffs(int x)
+static __inline__ int ffs(int x)
{
int r;
diff --git a/linux/src/include/asm-i386/io.h b/linux/src/include/asm-i386/io.h
index f961f1d..34cf105 100644
--- a/linux/src/include/asm-i386/io.h
+++ b/linux/src/include/asm-i386/io.h
@@ -45,12 +45,12 @@
* make the kernel segment mapped at 0, we need to do translation
* on the i386 as well)
*/
-extern inline unsigned long virt_to_phys(volatile void * address)
+static inline unsigned long virt_to_phys(volatile void * address)
{
return (unsigned long) _kvtophys(address);
}
-extern inline void * phys_to_virt(unsigned long address)
+static inline void * phys_to_virt(unsigned long address)
{
return (void *) phystokv(address);
}
@@ -90,7 +90,7 @@ extern inline void * phys_to_virt(unsigned long address)
*/
#define __OUT1(s,x) \
-extern inline void __out##s(unsigned x value, unsigned short port) {
+static inline void __out##s(unsigned x value, unsigned short port) {
#define __OUT2(s,s1,s2) \
__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
@@ -102,7 +102,7 @@ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "d"
(port)); SLOW_DOWN_IO; } \
__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
#define __IN1(s) \
-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
#define __IN2(s,s1,s2) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
@@ -114,12 +114,12 @@ __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port)
,##i ); SLOW_DOWN_IO; retu
__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO;
return _v; }
#define __INS(s) \
-extern inline void ins##s(unsigned short port, void * addr, unsigned long
count) \
+static inline void ins##s(unsigned short port, void * addr, unsigned long
count) \
{ __asm__ __volatile__ ("cld ; rep ; ins" #s \
: "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
#define __OUTS(s) \
-extern inline void outs##s(unsigned short port, const void * addr, unsigned
long count) \
+static inline void outs##s(unsigned short port, const void * addr, unsigned
long count) \
{ __asm__ __volatile__ ("cld ; rep ; outs" #s \
: "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
diff --git a/linux/src/include/asm-i386/segment.h
b/linux/src/include/asm-i386/segment.h
index 5f8af99..d23aa17 100644
--- a/linux/src/include/asm-i386/segment.h
+++ b/linux/src/include/asm-i386/segment.h
@@ -60,7 +60,11 @@ static inline void __attribute__((always_inline))
__put_user(unsigned long x, vo
:"ir" (x), "m" (*__sd(y)));
break;
default:
+#ifdef __OPTIMIZE__
bad_user_access_length();
+#else
+ asm volatile("ud2");
+#endif
}
}
@@ -85,7 +89,11 @@ static inline unsigned long __attribute__((always_inline))
__get_user(const void
:"m" (*__const_sd(y)));
return result;
default:
+#ifdef __OPTIMIZE__
return bad_user_access_length();
+#else
+ asm volatile("ud2");
+#endif
}
}
diff --git a/linux/src/include/asm-i386/semaphore.h
b/linux/src/include/asm-i386/semaphore.h
index c351c3a..18e12c1 100644
--- a/linux/src/include/asm-i386/semaphore.h
+++ b/linux/src/include/asm-i386/semaphore.h
@@ -45,7 +45,7 @@ extern void __up(struct semaphore * sem);
* "down_failed" is a special asm handler that calls the C
* routine that actually waits. See arch/i386/lib/semaphore.S
*/
-extern inline void down(struct semaphore * sem)
+static inline void down(struct semaphore * sem)
{
int d0;
__asm__ __volatile__(
@@ -86,7 +86,7 @@ asmlinkage int down_failed_interruptible(void); /* params in
registers */
* process can be killed. The down_failed_interruptible routine
* returns negative for signalled and zero for semaphore acquired.
*/
-extern inline int down_interruptible(struct semaphore * sem)
+static inline int down_interruptible(struct semaphore * sem)
{
int ret ;
@@ -113,7 +113,7 @@ extern inline int down_interruptible(struct semaphore * sem)
* The default case (no contention) will result in NO
* jumps for both down() and up().
*/
-extern inline void up(struct semaphore * sem)
+static inline void up(struct semaphore * sem)
{
int d0;
__asm__ __volatile__(
diff --git a/linux/src/include/linux/string.h b/linux/src/include/linux/string.h
index 214503c..62ff880 100644
--- a/linux/src/include/linux/string.h
+++ b/linux/src/include/linux/string.h
@@ -12,25 +12,33 @@ extern "C" {
#endif
extern char * ___strtok;
+#if 0
extern char * strcpy(char *,const char *);
extern char * strncpy(char *,const char *, __kernel_size_t);
extern char * strcat(char *, const char *);
extern char * strncat(char *, const char *, __kernel_size_t);
extern char * strchr(const char *,int);
extern char * strrchr(const char *,int);
+#endif
extern char * strpbrk(const char *,const char *);
extern char * strtok(char *,const char *);
extern char * strstr(const char *,const char *);
+#if 0
extern __kernel_size_t strlen(const char *);
extern __kernel_size_t strnlen(const char *,__kernel_size_t);
+#endif
extern __kernel_size_t strspn(const char *,const char *);
+#if 0
extern int strcmp(const char *,const char *);
extern int strncmp(const char *,const char *,__kernel_size_t);
+#endif
extern void * memset(void *,int,__kernel_size_t);
extern void * memcpy(void *,const void *,__kernel_size_t);
+#if 0
extern void * memmove(void *,const void *,__kernel_size_t);
extern void * memscan(void *,int,__kernel_size_t);
+#endif
extern int memcmp(const void *,const void *,__kernel_size_t);
/*
diff --git a/version.m4 b/version.m4
index 5cae3c1..55430c8 100644
--- a/version.m4
+++ b/version.m4
@@ -1,4 +1,4 @@
m4_define([AC_PACKAGE_NAME],[GNU Mach])
-m4_define([AC_PACKAGE_VERSION],[1.4+git20150704])
+m4_define([AC_PACKAGE_VERSION],[1.4+git20150709])
m4_define([AC_PACKAGE_BUGREPORT],address@hidden)
m4_define([AC_PACKAGE_TARNAME],[gnumach])
diff --git a/vm/vm_map.c b/vm/vm_map.c
index 6b13724..ae3ce21 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -208,6 +208,7 @@ void vm_map_setup(
rbtree_init(&map->hdr.tree);
map->size = 0;
+ map->user_wired = 0;
map->ref_count = 1;
map->pmap = pmap;
map->min_offset = min;
@@ -1409,7 +1410,10 @@ kern_return_t vm_map_pageable_common(
if (user_wire) {
if (--(entry->user_wired_count) == 0)
+ {
+ map->user_wired -= entry->vme_end -
entry->vme_start;
entry->wired_count--;
+ }
}
else {
entry->wired_count--;
@@ -1486,7 +1490,10 @@ kern_return_t vm_map_pageable_common(
if (user_wire) {
if ((entry->user_wired_count)++ == 0)
+ {
+ map->user_wired += entry->vme_end -
entry->vme_start;
entry->wired_count++;
+ }
}
else {
entry->wired_count++;
@@ -1512,6 +1519,7 @@ kern_return_t vm_map_pageable_common(
(entry->vme_end > start)) {
if (user_wire) {
if (--(entry->user_wired_count) == 0)
+ map->user_wired -= entry->vme_end -
entry->vme_start;
entry->wired_count--;
}
else {
@@ -1627,6 +1635,8 @@ void vm_map_entry_delete(
if (entry->wired_count != 0) {
vm_fault_unwire(map, entry);
entry->wired_count = 0;
+ if (entry->user_wired_count)
+ map->user_wired -= entry->vme_end - entry->vme_start;
entry->user_wired_count = 0;
}
@@ -2274,6 +2284,8 @@ start_pass_1:
entry->offset = copy_entry->offset;
entry->needs_copy = copy_entry->needs_copy;
entry->wired_count = 0;
+ if (entry->user_wired_count)
+ dst_map->user_wired -= entry->vme_end -
entry->vme_start;
entry->user_wired_count = 0;
vm_map_copy_entry_unlink(copy, copy_entry);
@@ -2869,6 +2881,7 @@ create_object:
if (must_wire) {
entry->wired_count = 1;
+ dst_map->user_wired += entry->vme_end - entry->vme_start;
entry->user_wired_count = 1;
} else {
entry->wired_count = 0;
@@ -3954,6 +3967,8 @@ retry:
assert(src_entry->wired_count > 0);
src_entry->wired_count = 0;
+ if (src_entry->user_wired_count)
+ src_map->user_wired -=
src_entry->vme_end - src_entry->vme_start;
src_entry->user_wired_count = 0;
unwire_end = src_entry->vme_end;
pmap_pageable(vm_map_pmap(src_map),
diff --git a/vm/vm_map.h b/vm/vm_map.h
index fc7730a..9b31f90 100644
--- a/vm/vm_map.h
+++ b/vm/vm_map.h
@@ -170,6 +170,7 @@ struct vm_map {
#define max_offset hdr.links.end /* end of range */
pmap_t pmap; /* Physical map */
vm_size_t size; /* virtual size */
+ vm_size_t user_wired; /* wired by user size */
int ref_count; /* Reference count */
decl_simple_lock_data(, ref_lock) /* Lock for ref_count field */
vm_map_entry_t hint; /* hint for quick lookups */
diff --git a/vm/vm_user.c b/vm/vm_user.c
index f7c87cc..8c7a5d8 100644
--- a/vm/vm_user.c
+++ b/vm/vm_user.c
@@ -405,15 +405,32 @@ kern_return_t vm_map(
*
* [ To unwire the pages, specify VM_PROT_NONE. ]
*/
-kern_return_t vm_wire(host, map, start, size, access)
- const host_t host;
+kern_return_t vm_wire(port, map, start, size, access)
+ const ipc_port_t port;
vm_map_t map;
vm_offset_t start;
vm_size_t size;
vm_prot_t access;
{
- if (host == HOST_NULL)
+ host_t host;
+ boolean_t priv;
+
+ if (!IP_VALID(port))
+ return KERN_INVALID_HOST;
+
+ ip_lock(port);
+ if (!ip_active(port) ||
+ (ip_kotype(port) != IKOT_HOST_PRIV
+ && ip_kotype(port) != IKOT_HOST))
+ {
+ ip_unlock(port);
return KERN_INVALID_HOST;
+ }
+
+ priv = ip_kotype(port) == IKOT_HOST_PRIV;
+ ip_unlock(port);
+
+ host = (host_t) port->ip_kobject;
if (map == VM_MAP_NULL)
return KERN_INVALID_TASK;
@@ -426,6 +443,10 @@ kern_return_t vm_wire(host, map, start, size, access)
if (projected_buffer_in_range(map, start, start+size))
return(KERN_INVALID_ARGUMENT);
+ /* TODO: make it tunable */
+ if (!priv && access != VM_PROT_NONE && map->user_wired + size > 65536)
+ return KERN_NO_ACCESS;
+
return vm_map_pageable_user(map,
trunc_page(start),
round_page(start+size),
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/gnumach.git