On 01/17/2014 03:56:39 PM, Justus Winter wrote:
Sounds promising, if they are in a shape to be presented, please
publish these patches somewhere.
I'll polish the quick hacks for libpthread and send it to the list.
Also, did you try some more complex programs?
Not yet. I'm looking for a prog
t, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+struct futex {
+ queue_chain_t chain; /* Futex cha
On 01/15/2014 10:56:25 AM, Justus Winter wrote:
> I tested a simple userspace mutex based on this and multiple
futexes,
> all tests passed.
Could you put that somewhere? I still have so little "context", I'd
like to see how futexe are used in a mutex implementation.
Here's what I used:
#inc
ense
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+struct futex
On 01/13/2014 06:28:44 PM, Richard Braun wrote:
On Mon, Jan 13, 2014 at 03:38:19PM +0100, Marin Ramesa wrote:
> Fixed a bug in private wakeups by calling ipc_entry_alloc_name().
>
> This is the last version as everything works now.
*Sigh*
You didn't understand my comment mention
ARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Mari
ceived a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast
On 01/09/2014 05:36:18 PM, Diego Nieto Cid wrote:
Finally, why is pfutexes an array? You are always using it's last
element (that is if the ARRAY_SIZE macro worked as intended).
I was actually not using it, so I didn't notice the bug while
testing. Thanks for the comments, the code has been cor
On 01/10/2014 01:59:55 AM, Richard Braun wrote:
On Thu, Jan 09, 2014 at 09:51:51PM +0100, Marin Ramesa wrote:
> On 01/09/2014 05:52:21 PM, Richard Braun wrote:
> >On Thu, Jan 09, 2014 at 05:06:09PM +0100, Marin Ramesa wrote:
> >> Shouldn't the compare be atomic. Maybe
On 01/09/2014 05:52:21 PM, Richard Braun wrote:
On Thu, Jan 09, 2014 at 05:06:09PM +0100, Marin Ramesa wrote:
> Shouldn't the compare be atomic. Maybe I don't understand what
> atomic really
> means but the GCC manual says this function is. Or is it enough to
> hold t
On 01/09/2014 03:45:35 PM, Richard Braun wrote:
> +/* TODO Should be per-task. */
> +static struct futex *pfutexes;
Most locks are private, so yes, do work on that too.
I actually did not implement this because I don't know how.
How to make a variable visible only and private to a task?
I trie
02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+
+struct futex {
+
+ /* Futex node in the futex tree. */
+
On 01/06/2014 03:00:35 PM, Richard Braun wrote:
We also need to make sure nothing bad happens to an (object, offset)
pair when, say, copy-on-write is performed by the VM system...
I'll add a check_consistency() routine to futex_wake() which repeats the
vm_map_lookup(). I'll use a sum of object
of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * When color of the node is red, parent of the node is the futex address,
left child is
+ * the futex waiter offset
On 12/31/2013 04:26:01 PM, Richard Braun wrote:
On Sun, Dec 29, 2013 at 09:44:51PM +0100, Marin Ramesa wrote:
> Futex waiters are now in a list and some bugs were fixed.
>
> I think this is now ready for test. I have tested this with
> malloc() and free() instead of kalloc() and
dation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#define futex_list_for_each(array, entry, list) \
+for (entry = &
.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+struct futex_hash_table {
+
+ /* Futex hash table lock. */
+ decl_simple_lock_data
On 12/28/2013 11:52:55 AM, Richard Braun wrote:
Here is how it probably should be :
There should be one futex_waiter struct per thread, allocated on the
stack when a thread is about to wait. That structure is then queued on
the futex it's waiting for, using the address of the futex as the
wakeup
On 12/27/2013 07:14:40 PM, Richard Braun wrote:
> +void futex_cross_address_space_wake(futex_t futex, boolean_t
wake_all)
> +{
> + #define min(x, y) (x <= y ? x : y)
> +
> + queue_iterate(&futex->chain, futex, futex_t, chain) {
> +
> + simple_lock(&futex->futex_wait_lock);
> +
> +
On 12/27/2013 09:58:07 PM, Richard Braun wrote:
On Fri, Dec 27, 2013 at 07:55:02PM +0100, Marin Ramesa wrote:
> On 12/27/2013 07:14:40 PM, Richard Braun wrote:
> >What do you mean when you say you test on the Hurd and Linux ? How
do
> >you use GDB with Mach to determine it
On 12/27/2013 07:14:40 PM, Richard Braun wrote:
On Fri, Dec 27, 2013 at 04:28:33PM +0100, Marin Ramesa wrote:
> On Hurd tests fail with a segmentation fault in kalloc() (GDB says
kalloc()
> segfaults in vm_map_find_entry()). On Linux everything works except
segfaults
> in vm_m
.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+#include
On 12/26/2013 03:25:11 PM, Richard Braun wrote:
On Thu, Dec 26, 2013 at 03:15:24PM +0100, Marin Ramesa wrote:
> I get segfaults in kalloc(). I don't know what I'm doing wrong.
Show us how you use it.
futex->futexed_threads =
(thread_t)kalloc((futex->num_futexed_threa
On 12/26/2013 02:58:01 PM, Richard Braun wrote:
Why __builtin_malloc and __builtin_free ??
I get segfaults in kalloc(). I don't know what I'm doing wrong.
> + if (futex->num_futexed_threads == 128)
> + return FUTEX_RESOURCE_SHORTAGE;
I assume this li
Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+
+static futex_hash_table_t table = NULL;
+static unsign
On 12/24/2013 05:20:41 PM, Richard Braun wrote:
On Tue, Dec 24, 2013 at 04:55:47PM +0100, Marin Ramesa wrote:
> I use a recursive futex_wake(). It first scans all the futexes if
> they are on the same offset and if they share the same vm_object.
> If they do, recursion is used to wake
On 12/24/2013 03:25:15 PM, Richard Braun wrote:
> There is a one call to vm_map lookup to retrive the offset and the
> object. Simple
How do you implement cross address space synchronization ?
I use a recursive futex_wake(). It first scans all the futexes if
they are on the same offset and if
I noticed this while testing the futex call. I don't know
how to fix this. The code to reproduce this is the
following:
extern int task_create();
struct task;
typedef struct task *task_t;
extern task_t kernel_task;
int main(void)
{
task_t new_task;
task_create(kernel_task, 0, &
On 12/24/2013 11:41:40 AM, Richard Braun wrote:
Obviously, you rushed your work without trying to understand what you
were doing, and this is becoming frustrating. Don't blindly and
mindlessly copy the first thing you see around...
1/ A simpleroutine is a one-way RPC, without a return value othe
On 23/12/13 10:58:12, Richard Braun wrote:
> Now that I think about it, you should already have at least one such
> entry on your system, whether Debian or not. Or are you saying you're
> not even running the Hurd at all ?!
Yes. I'm not running the Hurd. I plan on learning it after I finish
with
On 23/12/13 10:54:47, Richard Braun wrote:
> On Sun, Dec 22, 2013 at 11:56:39PM +0100, Marin Ramesa wrote:
> > Can you please show me the gnumach menuentry generated by grub?
>
> How about looking at the documentation ? For example
> http://www.gnu.org/software/grub/manual/grub
On 22/12/13 22:04:15, Richard Braun wrote:
> Whether it's in a virtual machine or a real one doesn't matter at
> all. On Debian, simply copy the gnumach binary to /boot and run
> update-grub. You'll get a new entry at boot time for your kernel.
I don't have the update-grub command (I'm not using
On 22.12.2013 18:25:10, Richard Braun wrote:
> On Sun, Dec 22, 2013 at 06:22:03PM +0100, Marin Ramesa wrote:
> > On 22.12.2013 17:56:32, Richard Braun wrote:
> > > Test it yourself from userspace before you resubmit.
> >
> > That's the problem. I don't
On 22.12.2013 17:56:32, Richard Braun wrote:
> > OK, I'm reading the documentation. In the meantime I have defined
> > several simple RPCs for testing purposes. I will send the updated
> > patch shortly.
>
> Test it yourself from userspace before you resubmit.
That's the problem. I don't know ho
General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Marin Ramesa
+ */
+
+/*
+ * Fast userspace locking
+ *
+ */
+
+#include
+#include
+
+static futex_hash_table_t table = NULL;
+static
On 22.12.2013 01:28:37, Richard Braun wrote:
> On Sat, Dec 21, 2013 at 11:29:34PM +0100, Marin Ramesa wrote:
> > On 21.12.2013 23:20:43, Richard Braun wrote:
> > > How about adding everything necessary to actually test it from
> > > userspace ?
> >
> > Sur
On 21.12.2013 23:20:43, Richard Braun wrote:
> On Sat, Dec 21, 2013 at 10:55:14PM +0100, Marin Ramesa wrote:
> > I noticed some bugs. I'm sending a fixed patch. The prevoius
> > version is here:
> > http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00493.html
>
On 21.12.2013 23:01:50, Svante Signell wrote:
> + * Copyright (c) 2013 Marin Ramesa
> + * All rights reserved.
> + *
> ...
> Why not e.g. a GPL licence, even if this function is good it might
> not be accepted due to this.
I don't know much about licenses, I copied th
ht (c) 2013 Marin Ramesa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this li
/kern/futex.c
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2013 Marin Ramesa
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must
On 20.12.2013 19:41:14, Marin Ramesa wrote:
> - insque((queue_entry_t) telt, ((queue_entry_t)next)->prev);
> + insque(&(telt->chain), *(&(next->chain).prev));
This should be simply:
- insque((queue_entry_t) telt, ((queue_entry_t)next)->prev);
+ i
Avoid the casts by specifying addresses of queue_chain_t members. If the
order of members in the structures ever changes, the code will be correct.
---
device/net_io.c | 4 ++--
kern/mach_clock.c | 10 +-
kern/processor.c | 2 +-
kern/sched_prim.c | 14 +++---
kern/task.c
---
ddb/db_aout.c | 4 ++--
ddb/db_break.c| 4 ++--
ddb/db_break.h| 2 +-
ddb/db_command.c | 2 +-
ddb/db_command.h | 2 +-
ddb/db_output.c | 2 +-
ddb/db_output.h | 2 +-
ddb/db_run.c | 2 +-
ddb/db_sym.c | 2 +-
device/dev_name.c | 2 +-
include/string.h | 8
Declare void argument lists that were not declared in the first
part of this patch and
* kern/sched_prim.h (recompute_priorities): Fix prototype.
* kern/startup.c (setup_main) (recompute_priorities): Fix call.
---
ddb/db_break.h | 4 ++--
ddb/db_watch.c | 2 +-
device/blkio.c |
* ddb/db_watch.c (db_watchpoint_cmd) (db_option): Remove forward declaration.
---
ddb/db_watch.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/ddb/db_watch.c b/ddb/db_watch.c
index 5551e66..dbb4aea 100644
--- a/ddb/db_watch.c
+++ b/ddb/db_watch.c
@@ -242,7 +242,6 @@ db_watchpoint_cmd(addr, h
* ddb/db_command.c (db_help_cmd): Mark with attribute unused.
---
ddb/db_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ddb/db_command.c b/ddb/db_command.c
index 3257e07..74134fb 100644
--- a/ddb/db_command.c
+++ b/ddb/db_command.c
@@ -382,7 +382,7 @@ struct db_comm
We already have noreturn attribute. I have identified two more
attributes that might be useful. These are pure and unused.
[PATCH 1/2] kern/strings.c (strlen): mark with attribute pure
Attribute pure means that a function doesn't have any effects except
the return value, and the return value does
* kern/strings.c (strlen): Mark with attribute pure.
---
kern/strings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kern/strings.c b/kern/strings.c
index 0752722..72eb4f3 100644
--- a/kern/strings.c
+++ b/kern/strings.c
@@ -161,7 +161,7 @@ strncpy(
* the terminating
On 18.12.2013 12:00:49, Richard Braun wrote:
> On Wed, Dec 18, 2013 at 11:40:09AM +0100, Marin Ramesa wrote:
> > On 18.12.2013 11:34:03, Richard Braun wrote:
> > > I don't get this warning, can you tell us how you configure GNU
> > > Mach ?
> >
> > --e
On 18.12.2013 11:34:03, Richard Braun wrote:
> On Wed, Dec 18, 2013 at 11:25:36AM +0100, Marin Ramesa wrote:
> > Yes, vou're right. I got confused. But then something else is
> > happening here. When I write the assertion this way:
> >
> > assert((entry ==
On 18.12.2013 11:11:10, Richard Braun wrote:
> The expression is ((a == NULL) || a->something), and I agree it is
> equivalent to !((a != NULL) && !a->something). And again, both the
> && and || operators are guaranteed to be evaluated left-to-right and
> *yield* without evaluating the second opera
On 18.12.2013 10:55:47, Marin Ramesa wrote:
> in order to return TRUE
Sorry, I meant to say in order to return FALSE.
On 18.12.2013 10:46:40, Richard Braun wrote:
> On Wed, Dec 18, 2013 at 10:37:03AM +0100, Marin Ramesa wrote:
> > Compiler needs to check both !a and !b. In order to evaluate !b it
> > must evaluate b. So when the code path is that when entry is a null
> > pointer, the evaluat
On 18.12.2013 10:20:21, Anatoly A. Kazantsev wrote:
> On Wed, 18 Dec 2013 09:17:47 +0100
> Marin Ramesa wrote:
>
> > ...
> > Negation of an
> > OR expression is an AND expression.
> > ...
>
> Maybe I did't get you correctly, but isn't !(a |
The problem is in this statement:
assert((entry == IE_NULL) || IE_BITS_TYPE(entry->ie_bits));
The macro assert() checks for a negation of this expression. Negation of an
OR expression is an AND expression. In order to evaluate an AND expression,
compiler needs to check both conditions. So it firs
Don't initialize to zero, rather move the initialization of size before
the break statement. Break on the first iteration should never happen, so the
position of initialization doesn't matter.
* ipc/mach_debug.c (host_ipc_hash_info) (size): Don't initialize to zero.
(host_ipc_hash_info) (size): Mo
The same situation as the previous patch.
* vm/vm_debug.c (host_virtual_physical_table_info) (size): Don't initialize to
zero.
(host_virtual_physical_table_info) (size): Move initialization before the break
statement.
---
vm/vm_debug.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-
On 18.12.2013 00:17:38, Richard Braun wrote:
> On Tue, Dec 17, 2013 at 03:58:27PM +0100, Marin Ramesa wrote:
> > Qualifier __restrict__ means that only the pointer under
> > __restrict__ will be used to access dereferenced values. So if a
> > code is under locks and no func
Qualifier __restrict__ means that only the pointer under __restrict__ will be
used
to access dereferenced values. So if a code is under locks and no function is
called
in the critical section with pointer as an argument, it's safe to use
__restrict__.
This allows the compiler to make optimizatio
* device/ds_routines.c (device_write_trap) (copyin) (data): Cast to (void *).
Argument is an address.
(device_write_trap) (copyin) (io_data): Don't cast.
(device_writev_trap) (copyin) (iovec, stack_iovec): Likewise.
(device_writev_trap) (copyin) (data, p): Cast to (void *). Arguments are
addresse
Modify structure device_emulation_ops so that correct argument types are listed.
This patch produces warnings in the linux code.
There is a previous version of this patch here:
http://lists.gnu.org/archive/html/bug-hurd/2013-11/msg00482.html
* device/device_emul.h (device_emulation_ops): Modify.
Attribute noreturn is used irrespective of __GNUC__. Remove
unnecessary #ifdef.
* kern/sched_prim.h [__GNUC__]: Remove #ifdef.
---
kern/sched_prim.h | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kern/sched_prim.h b/kern/sched_prim.h
index 07b5bf0..c7ff977 100644
--- a/k
---
vm/memory_object.c | 4 ++--
vm/memory_object_proxy.c | 8
vm/memory_object_proxy.h | 8
vm/vm_debug.c| 2 +-
vm/vm_external.c | 4 ++--
vm/vm_map.c | 8
vm/vm_print.h| 4 ++--
vm/vm_resident.c | 2 +-
vm/vm_
---
util/atoi.c | 8
util/atoi.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/util/atoi.c b/util/atoi.c
index 64816b9..e56f50d 100644
--- a/util/atoi.c
+++ b/util/atoi.c
@@ -91,11 +91,11 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int
mach_atoi(cp, nu
* kern/eventcount.c (simpler_thread_setrun) (enqueue_head) (th): Avoid the cast.
* kern/thread.c (thread_halt_self) (enqueue_tail) (thread): Likewise.
* kern/thread_swap.c (thread_swapin) (enqueue_tail) (thread): Likewise.
---
kern/eventcount.c | 2 +-
kern/thread.c | 2 +-
kern/thread_swap
---
kern/assert.h| 2 +-
kern/boot_script.c | 4 ++--
kern/debug.c | 6 +++---
kern/debug.h | 4 ++--
kern/eventcount.c| 2 +-
kern/host.c | 12 ++--
kern/ipc_host.c | 2 +-
kern/ipc_mig.c | 5 +++--
k
---
device/ds_routines.c | 2 +-
device/ds_routines.h | 2 +-
device/net_io.c | 2 +-
device/net_io.h | 2 +-
kern/eventcount.c| 2 +-
kern/machine.c | 2 +-
kern/machine.h | 2 +-
kern/sched_prim.c| 2 +-
kern/sched_prim.h| 8
kern/thread.c| 4 ++
---
i386/i386/ast_check.c| 4 ++--
i386/i386/db_disasm.c| 10 +-
i386/i386/db_interface.c | 14 +++---
i386/i386/db_interface.h | 2 +-
i386/i386/db_trace.c | 14 +++---
i386/i386/debug.h| 2 +-
i386/i386/debug_i386.c | 2 +-
i386/i386/fpu.c
---
device/chario.c | 10 +++
device/dev_hdr.h | 10 +++
device/dev_lookup.c | 10 +++
device/dev_name.c| 14 +-
device/dev_pager.c | 74 ++--
device/ds_routines.c | 28 ++--
device/ds_routines.h |
---
ipc/ipc_entry.c | 2 +-
ipc/ipc_mqueue.c | 6 +++---
ipc/ipc_object.c | 2 +-
ipc/ipc_port.c | 8
ipc/ipc_print.h | 6 +++---
ipc/ipc_pset.c | 2 +-
ipc/mach_rpc.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/ipc/ipc_entry.c b/ipc/ipc_entry.c
index
* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
[MACH_SLOCKS]: Remove #ifs.
* kern/task.c (task_lock, task_unlock): Remove address operator.
---
kern/lock.h | 6 --
kern/sched_prim.c | 18 +++
* ddb/db_command.h (db_error): Mark with attribute noreturn.
* i386/i386/setjmp.h (_longjmp): Likewise.
---
ddb/db_command.h | 2 +-
i386/i386/setjmp.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ddb/db_command.h b/ddb/db_command.h
index 5f0236a..634dd9d 100644
--- a/
On 15.12.2013 20:25:24, Samuel Thibault wrote:
> Marin Ramesa, le Sun 15 Dec 2013 20:22:02 +0100, a écrit :
> > On 15.12.2013 20:14:03, Samuel Thibault wrote:
> > > Marin Ramesa, le Thu 12 Dec 2013 18:27:05 +0100, a écrit :
> > > > There is a code p
* i386/i386/db_trace.c (db_lookup_i386_kreg) (kregp): Use (long *) instead of
an (int *).
---
i386/i386/db_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c
index 6247d4f..d0c434e 100644
--- a/i386/i386/db_trace.c
+++ b/i386/i
* kern/lock.h (simple_lock_data_empty): Define.
(decl_simple_lock_data, simple_unlock): Likewise.
* kern/sched_prim.c (lock): Declare.
* kern/task.c (task_lock, task_unlock) (task): Remove address operator.
---
kern/lock.h | 6 --
kern/sched_prim.c | 6 ++
kern/task.c | 4 ++--
On 15.12.2013 20:13:22, Samuel Thibault wrote:
> > index 8fe3672..67067cf 100644
> > --- a/kern/task.c
> > +++ b/kern/task.c
> > @@ -769,7 +769,7 @@ kern_return_t task_info(
> > event_info->cow_faults = task->cow_faults;
> > event_info->messages_sent = task->messages_sent;
On 15.12.2013 20:14:03, Samuel Thibault wrote:
> Marin Ramesa, le Thu 12 Dec 2013 18:27:05 +0100, a écrit :
> > There is a code path when db_error() can return.
>
> Which one?
When _longjmp() returns and db_recover and argument to db_error() are
non-zero.
On 15.12.2013 14:00:22, Richard Braun wrote:
> On Sat, Dec 14, 2013 at 01:32:27PM +0100, Marin Ramesa wrote:
> > On 14.12.2013 12:45:32, Richard Braun wrote:
> > > I really don't see a problem in that code, you'll have to
> > > describe it better.
> >
---
chips/busses.c | 8
chips/busses.h | 8
ddb/db_aout.c| 34 +-
ddb/db_break.c | 20 ++--
ddb/db_break.h | 12 ++--
ddb/db_command.c | 22 +++---
ddb/db_command.h |
This is a better version of this patch:
http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00400.html
It uses strlen(), instead of reimplementing it.
* device/chario.c: Include string.h.
(char_write): New if statement.
---
device/chario.c | 5 +
1 file changed, 5 insertions(+)
diff --g
On 14.12.2013 12:45:32, Richard Braun wrote:
> On Fri, Dec 13, 2013 at 09:06:55PM +0100, Marin Ramesa wrote:
> > Check if the source of the data in the source structure
> > memory is a target structure data. Do this by comparing the
> > length of the char values starting wi
This is a better version of this patch:
http://lists.gnu.org/archive/html/bug-hurd/2013-11/msg00474.html
* i386/i386/ast_check.c (init_ast_check, cause_ast_check): Define return type.
* i386/i386/pic.c (intnull, prtnull): Define argument types.
* i386/i386at/com.c (compr_addr): Likewise.
(compr):
* device/dev_pager.c (device_pager_data_request_done) (memset) (io_residual):
Cast to size_t instead to unsigned.
---
device/dev_pager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/device/dev_pager.c b/device/dev_pager.c
index b9796ca..7c3e088 100644
--- a/device/dev_page
The situation is that there is a pointer (source) that is being cast to
another pointer (target) and then the members of the target structure
pointed to by the target pointer are being used as if the content of
memory at the source address is a target structure, not source structure
pointed to by
Variable pager is already of ipc_port_t type.
* device/dev_pager.c: Remove unnecessary casts.
---
device/dev_pager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/device/dev_pager.c b/device/dev_pager.c
index 97e417e..b9796ca 100644
--- a/device/dev_pager.c
+++ b/device
Avoid the casts by passing the address of the links thread
structure member to enqueue_tail().
* kern/sched_prim.c: Avoid casts.
---
kern/sched_prim.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kern/sched_prim.c b/kern/sched_prim.c
index c06cd77..ec041fc 100644
---
Initialize lhs to zero to avoid uninitialized usage in db_unary().
* ddb/db_expr.c (db_mult_expr) (lhs): Initialize to zero.
---
ddb/db_expr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ddb/db_expr.c b/ddb/db_expr.c
index eee9e4f..82ada58 100644
--- a/ddb/db_expr.c
+++ b
This quiets the GCC warning about passing from incompatible pointer type.
* i386/i386/db_trace.c (db_i386_reg_value) (db_lookup_i386_kreg) (STACK_IKS):
Cast to (int *) instead to (long *).
---
i386/i386/db_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/i386/i386/db_
There is a code path when db_error() can return. Avoid, by writing returns,
deleting the breakpoint when breakpoint number is not valid or there is no
such breakpoint.
* ddb/db_break.c (db_delete_cmd): Add missing returns.
---
ddb/db_break.c | 2 ++
1 file changed, 2 insertions(+)
diff --git
Now that we have returns there are no more warnings from GCC about
uninitialized variable. Remove unnecessary initialization of variable
bkpt.
* ddb/db_break.c (db_delete_cmd) (bkpt): Remove unnecessary initialization.
---
ddb/db_break.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
di
Variable addr and member address are already of db_addr_t type which
is type defined as vm_offset_t.
* ddb/db_break.c (db_find_breakpoint_here) (DB_PHYS_EQ) (addr, address): Remove
unecessary casts.
---
ddb/db_break.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ddb/db_br
This is a better version of these two patches:
http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg6.html
http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00375.html
It uses an empty structure to represent a lock when !MACH_SLOCKS
and a modified simple_unlock() to quiet GCC warnings ab
On 12.12.2013 01:31:06, Richard Braun wrote:
> On Wed, Dec 11, 2013 at 09:07:38PM +0100, Marin Ramesa wrote:
> > On 11.12.2013 18:02:50, Richard Braun wrote:
> > > On Wed, Dec 11, 2013 at 05:30:43PM +0100, Marin Ramesa wrote:
> > > > - ipc_mqueue_t mqueue;
>
On 11.12.2013 19:12:33, Ivan Shmakov wrote:
>
> Even though I’m unsure how vm_offset_t is defined (is it int?
> or is it ptrdiff_t? ¹), I’d rather like to see casts to /int/
> here, as it’s what %X (usually – no idea about vm/*) implies.
>
> ¹ Please note that while int is 32 bits on
On 11.12.2013 18:02:50, Richard Braun wrote:
> On Wed, Dec 11, 2013 at 05:30:43PM +0100, Marin Ramesa wrote:
> > - ipc_mqueue_t mqueue;
> > + ipc_mqueue_t mqueue = mqueue; /* Quiet GCC warning. */
>
> Don't do that. Instead, tweak simple_unlock and similar functions
This is again that code where variable is assigned to itself, but
I don't know how to fix this the other way.
* server.c (WriteVarDecls) (msgh_simple): Assign to itself.
---
server.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server.c b/server.c
index 8496da7..793b9f
Members offset and phys_addr are of vm_offset_t types.
* vm/vm_resident.c (vm_page_print) (offset, phys_addr): Remove unnecessary
casts.
---
vm/vm_resident.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vm/vm_resident.c b/vm/vm_resident.c
index f0f31f6..dc99a79 100644
The return value from vm_map_min() is already of vm_offset_t type.
* vm/vm_kern.c (kmem_submap) (addr): Remove unnecessary cast.
---
vm/vm_kern.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vm/vm_kern.c b/vm/vm_kern.c
index 7e377ef..1c843ff 100644
--- a/vm/vm_kern.c
+++ b
1 - 100 of 585 matches
Mail list logo