Re: [PATCH 1/2] Port gdbserver to GNU/Hurd

2013-09-08 Thread Yue Lu
Hi,

On Fri, Sep 6, 2013 at 5:37 AM, Thomas Schwinge  wrote:
>> (correct me if
>> I'm wrong here), the Hurd's threads are kernel threads
>
> Correct.
>
>> so it'd
>> be better to just make the GDB side use the lwp field too.
>> It's really a simple and mechanic change.  Nothing in GDB core
>> actually cares which field is used.  So in this case, it'd be
>> better if you send a preparatory patch
>
> Based on the current upstream master branch.
>

Should I change the gdb use lwp filed instead of tid field? There are
too many functions use tid. Like
make_proc(),inf_tid_to_thread(),ptid_build(), and there is a field
named tid in the structure proc also.

We can define a macro for gdbserver to use another ptid_build function
to use lwp instead of tid, if this, we only need do a little change.

Because of there are a lot of place to improve in my patch, I will
submit my next patch a little later.  Now I have only finished
removing the spurious blank and the soft link.

-- 
Yue Lu (陆岳)



[PATCH] device: cleanup of the TTY io

2013-09-08 Thread Marin Ramesa
From tty.h I removed the ifdef and the include for luna88k, I
guess this was an architecture that is no longer supported as I can not
find the refrenced code in the gnumach source tree. From chario.c I 
removed forward declarations that have prototypes in tty.h. Next, I 
qualified all the constants with the const keyword, in this way there 
will be a warning from the compiler if their values get changed later 
in the code. I also removed the _PR calculation and broke it into two 
calculations (_PR_T and _PR_WM) that I wrote in tty.h, in this way they 
can be used by other parts of the code and we get rid of the confusing 
undef and redefinition in the chario_init(). Finaly, I dropped the 
register keyword as I can see that the newer functions, even in the 
same file by the same author, do not use it.
* device/tty.h [luna88k]: Remove ifdef and include for nonexistent header files.
New _PR_T calculation.
New _PR_WM calculation.
* device/chario.c (tty_flush): Remove forward declaration (prototype is in tty.h).
(ttstart): Likewise.
Qualify constants as constants.
(chario_init): Remove _PR calculation and the associated undef and break it in two in tty.h.
Drop the register keyword.



From 93dd68cc7c96dadde44fcd452e4aaf22cea7aecc Mon Sep 17 00:00:00 2001
From: Marin Ramesa 
Date: Sun, 8 Sep 2013 16:30:27 +0200
Subject: [PATCH 2/2] Cleanup of the TTY I/O.

---
 device/chario.c | 122 +++-
 device/tty.h|   7 ++--
 2 files changed, 61 insertions(+), 68 deletions(-)

diff --git a/device/chario.c b/device/chario.c
index d7c092e..efc024e 100644
--- a/device/chario.c
+++ b/device/chario.c
@@ -68,11 +68,9 @@ short	ttlowat[NSPEEDS] =
 void	queue_delayed_reply(
 	queue_t, io_req_t, boolean_t (*)(io_req_t));
 void	tty_output(struct tty *);
-void	tty_flush(struct tty *, int);
 boolean_t char_open_done(io_req_t);
 boolean_t char_read_done(io_req_t);
 boolean_t char_write_done(io_req_t);
-void	ttstart(struct tty *tp);
 
 /*
  * Fake 'line discipline' switch for the benefit of old code
@@ -91,9 +89,9 @@ struct ldisc_switch	linesw[] = {
 /*
  * Sizes for input and output circular buffers.
  */
-int	tty_inq_size = 4096;	/* big nuf */
-int	tty_outq_size = 2048;	/* Must be bigger that tthiwat */
-int	pdma_default = 1;   /* turn pseudo dma on by default */
+const int	tty_inq_size = 4096;	/* big nuf */
+const int	tty_outq_size = 2048;	/* Must be bigger that tthiwat */
+const int	pdma_default = 1;   /* turn pseudo dma on by default */
 
 /*
  * compute pseudo-dma tables
@@ -109,24 +107,23 @@ void chario_init(void)
  time for a character to show up if data is coming in at full data rate
  plus a little slack. 2 ticks is considered slack
  Below 300 baud we just glob a character at a time */
-#define _PR(x) ((hz/x) + 2)
 
   int i;
 
   for (i = B0; i < B300; i++)
 pdma_timeouts[i] = 0;
 
-  pdma_timeouts[B300] = _PR(30);
-  pdma_timeouts[B600] = _PR(60);
-  pdma_timeouts[B1200] = _PR(120);
-  pdma_timeouts[B1800] = _PR(180);
-  pdma_timeouts[B2400] = _PR(240);
-  pdma_timeouts[B4800] = _PR(480);
-  pdma_timeouts[B9600] = _PR(960);
-  pdma_timeouts[EXTA]  = _PR(1440); /* >14400 baud */
-  pdma_timeouts[EXTB]  = _PR(1920); /* >19200 baud */
-  pdma_timeouts[B57600] = _PR(5760);
-  pdma_timeouts[B115200] = _PR(11520);
+  pdma_timeouts[B300] = _PR_T(30);
+  pdma_timeouts[B600] = _PR_T(60);
+  pdma_timeouts[B1200] = _PR_T(120);
+  pdma_timeouts[B1800] = _PR_T(180);
+  pdma_timeouts[B2400] = _PR_T(240);
+  pdma_timeouts[B4800] = _PR_T(480);
+  pdma_timeouts[B9600] = _PR_T(960);
+  pdma_timeouts[EXTA]  = _PR_T(1440); /* >14400 baud */
+  pdma_timeouts[EXTB]  = _PR_T(1920); /* >19200 baud */
+  pdma_timeouts[B57600] = _PR_T(5760);
+  pdma_timeouts[B115200] = _PR_T(11520);
 
   for (i = B0; i < B300; i++)
 pdma_water_mark[i] = 0;
@@ -135,15 +132,12 @@ void chario_init(void)
  (20% of the character rate). For the faster lines,
  we try to buffer 1/2 the input queue size */
 
-#undef _PR
-#define _PR(x) (0.20 * x)
-
-  pdma_water_mark[B300] = _PR(120);
-  pdma_water_mark[B600] = _PR(120);
-  pdma_water_mark[B1200] = _PR(120);
-  pdma_water_mark[B1800] = _PR(180);
-  pdma_water_mark[B2400] = _PR(240);
-  pdma_water_mark[B4800] = _PR(480);
+  pdma_water_mark[B300] = _PR_WM(120);
+  pdma_water_mark[B600] = _PR_WM(120);
+  pdma_water_mark[B1200] = _PR_WM(120);
+  pdma_water_mark[B1800] = _PR_WM(180);
+  pdma_water_mark[B2400] = _PR_WM(240);
+  pdma_water_mark[B4800] = _PR_WM(480);
   i = tty_inq_size/2;
   pdma_water_mark[B9600] = i;
   pdma_water_mark[EXTA]  = i; /* >14400 baud */
@@ -216,7 +210,7 @@ out:
 boolean_t char_open_done(
 	io_req_t	ior)
 {
-	register struct tty *tp = (struct tty *)ior->io_dev_ptr;
+	struct tty *tp = (struct tty *)ior->io_dev_ptr;
 	spl_t s = spltty();
 
 	simple_lock(&tp->t_lock);
@@ -256,12 +250,12 @@ boolean_t tty_close_open_reply(
  * device needs to run on master.
  */
 io_return_t char_write(
-	register struct tty *	tp,
-	reg

Re: [PATCH] device: cleanup of the TTY io

2013-09-08 Thread Justus Winter
Hi Marin :)

I think it is awesome of you to start cleaning up gnumach, this is
much overdue. But you shouldn't mash so many changes into one patch,
rather split it up. By the way, gnumach uses git and using git it is
very easy to keep separate changes in your local working branch in
separate commits. You can then massage them into shape over time and
when you are done there's this nice git send-email command to send all
your patches to the list. This way they are easier to review and to
merge upstream.

Justus



Re: [PATCH] device: cleanup of the TTY io

2013-09-08 Thread Marin Ramesa
On 08.09.2013 18:53:02, Justus Winter wrote:
> Hi Marin :)
> 
> I think it is awesome of you to start cleaning up gnumach, this is
> much overdue. But you shouldn't mash so many changes into one patch,
> rather split it up. By the way, gnumach uses git and using git it is
> very easy to keep separate changes in your local working branch in
> separate commits. You can then massage them into shape over time and
> when you are done there's this nice git send-email command to send 
> all your patches to the list. This way they are easier to review and 
> to merge upstream.
> 
> Justus

Hi Justus,

I liked the cleanup project idea, it gives me a chance to learn gnumach 
code while at the same time doing some hopefully useful stuff. But as 
you might have guessed this is all new to me so I don't have in 
perspective what is the best way to do stuff and how to make things 
easier for Samuel and others who maintain gnumach. So thanks for the 
valuable advice and feedback, I will have it in mind when I work on the 
next patch. 





Test status update for dbus, glib2.0 and gamin

2013-09-08 Thread Svante Signell
Hi, in order not to leave all results on #hurd@irc I'm updating the
current status:
with my patched eglibc supporting SCM_CREDS this is the current test
status:
good news: all 10 gamin tests pass, 5(8) dbus, 51(52) glib2.0, 58(62)
glib2.0/gio
bad news: emacs in X still hangs, many X-window sessions fail, including
xfce4, lxde and e17

There is still hope, some of the failing tests are interesting, digging
further





[PATCH] kern: remove all trace of luna88k arch

2013-09-08 Thread Marin Ramesa
Simple patch to remove all trace of the luna88k arch. 
By the way, I'm sending this to the list as a test for git-send-email
as Justus suggested, so if something unexpected happens (like a duplication
or something) please just ignore it.

* kern/debug.c: Remove check for luna88k.

---
 kern/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kern/debug.c b/kern/debug.c
index 09c8ff4..7f6e555 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -96,7 +96,7 @@ void SoftDebugger(message)
asm("ta 0x81");
 #endif /* sun4 */
 
-#ifdefined(mips ) || defined(luna88k) || defined(i860) || defined(alpha)
+#ifdefined(mips ) || defined(i860) || defined(alpha)
gimmeabreak();
 #endif
 
-- 
1.8.1.4