* [PATCH] http: use strbuf API in quote_ref_url
From: Tay Ray Chuan @ 2009-03-07 15:40 UTC (permalink / raw)
To: git, Johannes Schindelin
In addition, ''quote_ref_url'' inserts a slash between the base URL and
remote ref path only if needed. Previously, this insertion wasn't
contingent on the lack of a separating slash.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
http.c | 29 ++++++++++-------------------
1 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/http.c b/http.c
index cdedeb6..9de4130 100644
--- a/http.c
+++ b/http.c
@@ -577,31 +577,22 @@ static inline int hex(int v)
static char *quote_ref_url(const char *base, const char *ref)
{
+ struct strbuf buf = STRBUF_INIT;
const char *cp;
- char *dp, *qref;
- int len, baselen, ch;
+ int ch;
+
+ strbuf_addstr(&buf, base);
+ if (strcmp(base+strlen(base)-1, "/") && strcmp(ref, "/"))
+ strbuf_addstr(&buf, "/");
- baselen = strlen(base);
- len = baselen + 2; /* '/' after base and terminating NUL */
- for (cp = ref; (ch = *cp) != 0; cp++, len++)
- if (needs_quote(ch))
- len += 2; /* extra two hex plus replacement % */
- qref = xmalloc(len);
- memcpy(qref, base, baselen);
- dp = qref + baselen;
- *(dp++) = '/';
for (cp = ref; (ch = *cp) != 0; cp++) {
- if (needs_quote(ch)) {
- *dp++ = '%';
- *dp++ = hex((ch >> 4) & 0xF);
- *dp++ = hex(ch & 0xF);
- }
+ if (needs_quote(ch))
+ strbuf_addf(&buf, "%%%02x", ch);
else
- *dp++ = ch;
+ strbuf_addch(&buf, *cp);
}
- *dp = 0;
- return qref;
+ return strbuf_detach(&buf, NULL);
}
int http_fetch_ref(const char *base, struct ref *ref)
--
1.6.2.rc1
^ permalink raw reply related
* Re: [PATCH 4/5] OMAP3430SDP: Add support for Camera Kit v3
From: Alexey Klimov @ 2009-03-07 15:41 UTC (permalink / raw)
To: DongSoo(Nathaniel) Kim
Cc: Curran, Dominic, Aguirre Rodriguez, Sergio Alberto,
linux-media@vger.kernel.org, linux-omap@vger.kernel.org,
Sakari Ailus, Tuukka.O Toivonen, Hiroshi DOYU, MiaoStanley,
Nagalla, Hari, Hiremath, Vaibhav, Lakhani, Amish, Menon, Nishanth
In-Reply-To: <5e9665e10903051754i6eea2709l5178083097807242@mail.gmail.com>
Hello, all
On Fri, 2009-03-06 at 10:54 +0900, DongSoo(Nathaniel) Kim wrote:
> Hi Alexey,
>
> On Fri, Mar 6, 2009 at 7:05 AM, Alexey Klimov <klimov.linux@gmail.com> wrote:
> > Hello, all
> >
> > On Thu, Mar 5, 2009 at 7:42 PM, Curran, Dominic <dcurran@ti.com> wrote:
> >>
> >> Hi Kim
> >>
> >>> -----Original Message-----
> >>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> >>> owner@vger.kernel.org] On Behalf Of DongSoo(Nathaniel) Kim
> >>> Sent: Wednesday, March 04, 2009 8:58 PM
> >>> To: Aguirre Rodriguez, Sergio Alberto
> >>> Cc: linux-media@vger.kernel.org; linux-omap@vger.kernel.org; Sakari Ailus;
> >>> Tuukka.O Toivonen; Hiroshi DOYU; MiaoStanley; Nagalla, Hari; Hiremath,
> >>> Vaibhav; Lakhani, Amish; Menon, Nishanth
> >>> Subject: Re: [PATCH 4/5] OMAP3430SDP: Add support for Camera Kit v3
> >>>
> >>> Hi Sergio,
> >>>
> >>>
> >>>
> >>> On Wed, Mar 4, 2009 at 5:44 AM, Aguirre Rodriguez, Sergio Alberto
> >>> <saaguirre@ti.com> wrote:
> >>> > + /* turn on analog power */
> >>> > + twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
> >>> > + VAUX_2_8_V, TWL4030_VAUX2_DEDICATED);
> >>> > + twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
> >>> > + VAUX_DEV_GRP_P1, TWL4030_VAUX2_DEV_GRP);
> >>> > +
> >>> > + /* out of standby */
> >>> > + gpio_set_value(MT9P012_STANDBY_GPIO, 0);
> >>> > + udelay(1000);
> >>>
> >>> It seems better using msleep rather than udelay for 1000us much. Just
> >>> to be safe :)
> >>> How about you?
> >>>
> >>
> >> Why is msleep safer than udelay ?
> >
> > I have small guess that he is wondering why you are using big delays
> > with help of udelay(). (It's may be obvious but as we know udelay uses
> > cpu loops to make delay and msleep calls to scheduler) So, msleep is
> > more flexible and "softer" but if you need precise time or you can't
> > sleep in code you need udelay. Sometimes using udelay is reasonably
> > required.
>
> I totally agree with you.
> But besides the "udelay and mdelay accuracy" issue, Sergio's power up
> timing for MT9P012 seems to delay too much. (not for lens
> controller.)
> I also have experience using MT9P012 sensor with other ISP, but in
> case of mine it took 600 to 800 ms for whole power up sequence.
> But if that delay depends on SDP board and Sergio had no options
> without making delay for that much, then it explains everything.
> So I'm saying if there was no other option than making long delay to
> bring up MT9P012 sensor properly, if I were Sergio I should rather use
> mdelay than udelay.
I agree with you. mdelay is really safer that udelay.
>From file include/linux/delay.h:
* Using udelay() for intervals greater than a few milliseconds can
* risk overflow for high loops_per_jiffy (high bogomips) machines. The
* mdelay() provides a wrapper to prevent this. For delays greater
* than MAX_UDELAY_MS milliseconds, the wrapper is used. Architecture
* specific values can be defined in asm-???/delay.h as an override.
So, let's Sergio check and decide what he needed! :)
> Cheers,
>
> Nate
--
Best regards, Klimov Alexey
^ permalink raw reply
* Re: [PATCH] toshiba_acpi: Add full hotkey support
From: Andrey Borzenkov @ 2009-03-07 15:38 UTC (permalink / raw)
To: Matthew Garrett; +Cc: linux-acpi, linux-kernel, hal, Richard Hughes
In-Reply-To: <20090307150640.GA3516@srcf.ucam.org>
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
On 7 марта 2009 18:06:40 Matthew Garrett wrote:
> On Sat, Mar 07, 2009 at 10:27:09AM +0300, Andrey Borzenkov wrote:
> > Matthew Garrett wrote:
> > > + {KE_KEY, 0x13d, KEY_SLEEP},
> > > + {KE_KEY, 0x13e, KEY_SUSPEND},
> >
> > I have two buttons marked with memory and disk pictures. When I
> > press the first one HAL emits "sleep" button event, for the the
> > second one HAL emits "hibernate" event. I am using KDE4 and neither
> > works :) According to KDE4 developer, they implement "suspend"
> > button as suspend to RAM. Just trying to clarify which key this
> > should be and whether HAL should be fixed. (I opened bug report
> > for KDE4)
>
> Yeah, I'm not really a KDE guy, so I'm not sure what's happening
> there.
>
Please see reply to another thread titled "Re: suspend / hibernate
nomenclature". What happens here is
- addon-acpi-buttons-toshiba emitted "suspend" for Fn-F3 and "hibernate"
for Fn-F4
- your patch makes HAL emit "sleep" for Fn-F3 and "hibernate" for Fn-F4
So the patch is incompatible change w.r.t. user space. To restore
previous behaviour we need
- patch toshiba_acpi to return KEY_SUSPEND/KEY_HIBERNATE instead of
KEY_SLEEP/KEY_SUSPEND. This depends on commit
6932b918e05b06165ed3457a9f3aa279099a7cbd in linux-next.
- patch HAL to recognize KEY_HIBERNATE and return "suspend" for
KEY_SUSPEND; right now it is:
[KEY_SLEEP] = "sleep",
[KEY_SUSPEND] = "hibernate",
In any case this means that combination of old HAL and new kernel (or
vice versa) becomes broken. Not sure how to handle it.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [Design] nested partitions: Unify grub_partition and grub_disk
From: Robert Millan @ 2009-03-07 15:38 UTC (permalink / raw)
To: The development of GRUB 2
In-Reply-To: <49B28BA6.3030109@gmail.com>
On Sat, Mar 07, 2009 at 03:58:46PM +0100, phcoder wrote:
> Hello. I was looking into nested partitions issue and propose to unify
> grub_partition and grub_disk. In this case when a code calls
> grub_disk_read with a grub_disk_t which represents a partition it will
> correct the offset and call grub_disk_read with underlying partition or
> disk. In this way not only nested partitions become natural but also
> conceptually similar fields of total_sectors and len become unified. As
> it's an important design change I send this e-mail before coding it
Makes sense to me. But it'd be interesting to hear from the person who
designed it this way. Perhaps there's a non-obvious reason.
Who's that? Maybe Marco or Okuji?
Also an interesting question is how would "has_partitions" field be
handled in this scheme.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply
* Re: [PATCH for tip] ftrace: remove latency_trace document
From: Frederic Weisbecker @ 2009-03-07 15:34 UTC (permalink / raw)
To: KOSAKI Motohiro; +Cc: Ingo Molnar, Steven Rostedt, LKML
In-Reply-To: <20090307235209.5A84.A69D9226@jp.fujitsu.com>
On Sat, Mar 07, 2009 at 11:53:40PM +0900, KOSAKI Motohiro wrote:
> Subject: [PATCH] remove latency_trace document
>
> Currently, there aren't "Latency tracer" and latency_trace file.
> Then, its documentation is removed too.
>
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
Hi,
The latency_trace file has been removed but the latency tracing stil exists.
It has become an option instead of a file now:
echo latency-format > /debugfs/tracing/trace_options
There are even some tracers that default enable it (irqsoff, preemptoff...)
IMO, the documentation about latency tracing shouldn't be removed but
just updated a bit to reflect this change.
Frederic.
> Documentation/ftrace.txt | 550 +--------------------------------------------
> 1 files changed, 13 insertions(+), 537 deletions(-)
>
> diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
> index 22614be..d124e6a 100644
> --- a/Documentation/ftrace.txt
> +++ b/Documentation/ftrace.txt
> @@ -29,7 +29,7 @@ means that the list of tracers can always grow).
>
> The File System
> ---------------
> -
> +1
> Ftrace uses the debugfs file system to hold the control files as
> well as the files to display output.
>
> @@ -73,26 +73,19 @@ of ftrace. Here is a list of some of the key files:
> This file holds the output of the trace in a human
> readable format (described below).
>
> - latency_trace:
> -
> - This file shows the same trace but the information
> - is organized more to display possible latencies
> - in the system (described below).
> -
> trace_pipe:
>
> The output is the same as the "trace" file but this
> file is meant to be streamed with live tracing.
> Reads from this file will block until new data
> - is retrieved. Unlike the "trace" and "latency_trace"
> - files, this file is a consumer. This means reading
> - from this file causes sequential reads to display
> - more current data. Once data is read from this
> - file, it is consumed, and will not be read
> - again with a sequential read. The "trace" and
> - "latency_trace" files are static, and if the
> - tracer is not adding more data, they will display
> - the same information every time they are read.
> + is retrieved. Unlike the "trace" file, this file
> + is a consumer. This means reading from this file
> + causes sequential reads to display more current data.
> + Once data is read from this file, it is consumed,
> + and will not be read again with a sequential read.
> + The "trace" files is static, and if the tracer is not
> + adding more data, they will display the same information
> + every time they are read.
>
> trace_options:
>
> @@ -105,10 +98,10 @@ of ftrace. Here is a list of some of the key files:
> Some of the tracers record the max latency.
> For example, the time interrupts are disabled.
> This time is saved in this file. The max trace
> - will also be stored, and displayed by either
> - "trace" or "latency_trace". A new max trace will
> - only be recorded if the latency is greater than
> - the value in this file. (in microseconds)
> + will also be stored, and displayed by "trace".
> + A new max trace will only be recorded if the
> + latency is greater than the value in this file.
> + (in microseconds)
>
> buffer_size_kb:
>
> @@ -192,25 +185,6 @@ Here is the list of current tracers that may be configured.
>
> Traces the context switches and wakeups between tasks.
>
> - "irqsoff"
> -
> - Traces the areas that disable interrupts and saves
> - the trace with the longest max latency.
> - See tracing_max_latency. When a new max is recorded,
> - it replaces the old trace. It is best to view this
> - trace via the latency_trace file.
> -
> - "preemptoff"
> -
> - Similar to irqsoff but traces and records the amount of
> - time for which preemption is disabled.
> -
> - "preemptirqsoff"
> -
> - Similar to irqsoff and preemptoff, but traces and
> - records the largest time for which irqs and/or preemption
> - is disabled.
> -
> "wakeup"
>
> Traces and records the max latency that it takes for
> @@ -292,97 +266,6 @@ nice 19. The prio "140" is reserved for the idle task which is
> the lowest priority thread (pid 0).
>
>
> -Latency trace format
> ---------------------
> -
> -For traces that display latency times, the latency_trace file
> -gives somewhat more information to see why a latency happened.
> -Here is a typical trace.
> -
> -# tracer: irqsoff
> -#
> -irqsoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: apic_timer_interrupt
> - => ended at: do_softirq
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt)
> - <idle>-0 0d.s. 97us : __do_softirq (do_softirq)
> - <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq)
> -
> -
> -This shows that the current tracer is "irqsoff" tracing the time
> -for which interrupts were disabled. It gives the trace version
> -and the version of the kernel upon which this was executed on
> -(2.6.26-rc8). Then it displays the max latency in microsecs (97
> -us). The number of trace entries displayed and the total number
> -recorded (both are three: #3/3). The type of preemption that was
> -used (PREEMPT). VP, KP, SP, and HP are always zero and are
> -reserved for later use. #P is the number of online CPUS (#P:2).
> -
> -The task is the process that was running when the latency
> -occurred. (swapper pid: 0).
> -
> -The start and stop (the functions in which the interrupts were
> -disabled and enabled respectively) that caused the latencies:
> -
> - apic_timer_interrupt is where the interrupts were disabled.
> - do_softirq is where they were enabled again.
> -
> -The next lines after the header are the trace itself. The header
> -explains which is which.
> -
> - cmd: The name of the process in the trace.
> -
> - pid: The PID of that process.
> -
> - CPU#: The CPU which the process was running on.
> -
> - irqs-off: 'd' interrupts are disabled. '.' otherwise.
> - Note: If the architecture does not support a way to
> - read the irq flags variable, an 'X' will always
> - be printed here.
> -
> - need-resched: 'N' task need_resched is set, '.' otherwise.
> -
> - hardirq/softirq:
> - 'H' - hard irq occurred inside a softirq.
> - 'h' - hard irq is running
> - 's' - soft irq is running
> - '.' - normal context.
> -
> - preempt-depth: The level of preempt_disabled
> -
> -The above is mostly meaningful for kernel developers.
> -
> - time: This differs from the trace file output. The trace file output
> - includes an absolute timestamp. The timestamp used by the
> - latency_trace file is relative to the start of the trace.
> -
> - delay: This is just to help catch your eye a bit better. And
> - needs to be fixed to be only relative to the same CPU.
> - The marks are determined by the difference between this
> - current trace and the next trace.
> - '!' - greater than preempt_mark_thresh (default 100)
> - '+' - greater than 1 microsecond
> - ' ' - less than or equal to 1 microsecond.
> -
> - The rest is the same as the 'trace' file.
> -
> -
> trace_options
> -------------
>
> @@ -556,413 +439,6 @@ functions that are within the trace. The descriptions of the
> tracers will also show an example with ftrace enabled.
>
>
> -irqsoff
> --------
> -
> -When interrupts are disabled, the CPU can not react to any other
> -external event (besides NMIs and SMIs). This prevents the timer
> -interrupt from triggering or the mouse interrupt from letting
> -the kernel know of a new mouse event. The result is a latency
> -with the reaction time.
> -
> -The irqsoff tracer tracks the time for which interrupts are
> -disabled. When a new maximum latency is hit, the tracer saves
> -the trace leading up to that latency point so that every time a
> -new maximum is reached, the old saved trace is discarded and the
> -new trace is saved.
> -
> -To reset the maximum, echo 0 into tracing_max_latency. Here is
> -an example:
> -
> - # echo irqsoff > /debug/tracing/current_tracer
> - # echo 0 > /debug/tracing/tracing_max_latency
> - # echo 1 > /debug/tracing/tracing_enabled
> - # ls -ltr
> - [...]
> - # echo 0 > /debug/tracing/tracing_enabled
> - # cat /debug/tracing/latency_trace
> -# tracer: irqsoff
> -#
> -irqsoff latency trace v1.1.5 on 2.6.26
> ---------------------------------------------------------------------
> - latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: sys_setpgid
> - => ended at: sys_setpgid
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - bash-3730 1d... 0us : _write_lock_irq (sys_setpgid)
> - bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid)
> - bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid)
> -
> -
> -Here we see that that we had a latency of 12 microsecs (which is
> -very good). The _write_lock_irq in sys_setpgid disabled
> -interrupts. The difference between the 12 and the displayed
> -timestamp 14us occurred because the clock was incremented
> -between the time of recording the max latency and the time of
> -recording the function that had that latency.
> -
> -Note the above example had ftrace_enabled not set. If we set the
> -ftrace_enabled, we get a much larger output:
> -
> -# tracer: irqsoff
> -#
> -irqsoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: __alloc_pages_internal
> - => ended at: __alloc_pages_internal
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal)
> - ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist)
> - ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk)
> - ls-4339 0d..1 4us : add_preempt_count (_spin_lock)
> - ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk)
> - ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue)
> - ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest)
> - ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk)
> - ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue)
> - ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest)
> - ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk)
> - ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue)
> -[...]
> - ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue)
> - ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest)
> - ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk)
> - ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue)
> - ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest)
> - ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk)
> - ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock)
> - ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal)
> - ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal)
> -
> -
> -
> -Here we traced a 50 microsecond latency. But we also see all the
> -functions that were called during that time. Note that by
> -enabling function tracing, we incur an added overhead. This
> -overhead may extend the latency times. But nevertheless, this
> -trace has provided some very helpful debugging information.
> -
> -
> -preemptoff
> -----------
> -
> -When preemption is disabled, we may be able to receive
> -interrupts but the task cannot be preempted and a higher
> -priority task must wait for preemption to be enabled again
> -before it can preempt a lower priority task.
> -
> -The preemptoff tracer traces the places that disable preemption.
> -Like the irqsoff tracer, it records the maximum latency for
> -which preemption was disabled. The control of preemptoff tracer
> -is much like the irqsoff tracer.
> -
> - # echo preemptoff > /debug/tracing/current_tracer
> - # echo 0 > /debug/tracing/tracing_max_latency
> - # echo 1 > /debug/tracing/tracing_enabled
> - # ls -ltr
> - [...]
> - # echo 0 > /debug/tracing/tracing_enabled
> - # cat /debug/tracing/latency_trace
> -# tracer: preemptoff
> -#
> -preemptoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: do_IRQ
> - => ended at: __do_softirq
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - sshd-4261 0d.h. 0us+: irq_enter (do_IRQ)
> - sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq)
> - sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq)
> -
> -
> -This has some more changes. Preemption was disabled when an
> -interrupt came in (notice the 'h'), and was enabled while doing
> -a softirq. (notice the 's'). But we also see that interrupts
> -have been disabled when entering the preempt off section and
> -leaving it (the 'd'). We do not know if interrupts were enabled
> -in the mean time.
> -
> -# tracer: preemptoff
> -#
> -preemptoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: remove_wait_queue
> - => ended at: __do_softirq
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue)
> - sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue)
> - sshd-4261 0d..1 2us : do_IRQ (common_interrupt)
> - sshd-4261 0d..1 2us : irq_enter (do_IRQ)
> - sshd-4261 0d..1 2us : idle_cpu (irq_enter)
> - sshd-4261 0d..1 3us : add_preempt_count (irq_enter)
> - sshd-4261 0d.h1 3us : idle_cpu (irq_enter)
> - sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ)
> -[...]
> - sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock)
> - sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq)
> - sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq)
> - sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq)
> - sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock)
> - sshd-4261 0d.h1 14us : irq_exit (do_IRQ)
> - sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit)
> - sshd-4261 0d..2 15us : do_softirq (irq_exit)
> - sshd-4261 0d... 15us : __do_softirq (do_softirq)
> - sshd-4261 0d... 16us : __local_bh_disable (__do_softirq)
> - sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable)
> - sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable)
> -[...]
> - sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable)
> - sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable)
> - sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip)
> - sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip)
> - sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable)
> -[...]
> - sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq)
> - sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq)
> -
> -
> -The above is an example of the preemptoff trace with
> -ftrace_enabled set. Here we see that interrupts were disabled
> -the entire time. The irq_enter code lets us know that we entered
> -an interrupt 'h'. Before that, the functions being traced still
> -show that it is not in an interrupt, but we can see from the
> -functions themselves that this is not the case.
> -
> -Notice that __do_softirq when called does not have a
> -preempt_count. It may seem that we missed a preempt enabling.
> -What really happened is that the preempt count is held on the
> -thread's stack and we switched to the softirq stack (4K stacks
> -in effect). The code does not copy the preempt count, but
> -because interrupts are disabled, we do not need to worry about
> -it. Having a tracer like this is good for letting people know
> -what really happens inside the kernel.
> -
> -
> -preemptirqsoff
> ---------------
> -
> -Knowing the locations that have interrupts disabled or
> -preemption disabled for the longest times is helpful. But
> -sometimes we would like to know when either preemption and/or
> -interrupts are disabled.
> -
> -Consider the following code:
> -
> - local_irq_disable();
> - call_function_with_irqs_off();
> - preempt_disable();
> - call_function_with_irqs_and_preemption_off();
> - local_irq_enable();
> - call_function_with_preemption_off();
> - preempt_enable();
> -
> -The irqsoff tracer will record the total length of
> -call_function_with_irqs_off() and
> -call_function_with_irqs_and_preemption_off().
> -
> -The preemptoff tracer will record the total length of
> -call_function_with_irqs_and_preemption_off() and
> -call_function_with_preemption_off().
> -
> -But neither will trace the time that interrupts and/or
> -preemption is disabled. This total time is the time that we can
> -not schedule. To record this time, use the preemptirqsoff
> -tracer.
> -
> -Again, using this trace is much like the irqsoff and preemptoff
> -tracers.
> -
> - # echo preemptirqsoff > /debug/tracing/current_tracer
> - # echo 0 > /debug/tracing/tracing_max_latency
> - # echo 1 > /debug/tracing/tracing_enabled
> - # ls -ltr
> - [...]
> - # echo 0 > /debug/tracing/tracing_enabled
> - # cat /debug/tracing/latency_trace
> -# tracer: preemptirqsoff
> -#
> -preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: apic_timer_interrupt
> - => ended at: __do_softirq
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt)
> - ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq)
> - ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq)
> -
> -
> -
> -The trace_hardirqs_off_thunk is called from assembly on x86 when
> -interrupts are disabled in the assembly code. Without the
> -function tracing, we do not know if interrupts were enabled
> -within the preemption points. We do see that it started with
> -preemption enabled.
> -
> -Here is a trace with ftrace_enabled set:
> -
> -
> -# tracer: preemptirqsoff
> -#
> -preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
> ---------------------------------------------------------------------
> - latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
> - -----------------
> - | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
> - -----------------
> - => started at: write_chan
> - => ended at: __do_softirq
> -
> -# _------=> CPU#
> -# / _-----=> irqs-off
> -# | / _----=> need-resched
> -# || / _---=> hardirq/softirq
> -# ||| / _--=> preempt-depth
> -# |||| /
> -# ||||| delay
> -# cmd pid ||||| time | caller
> -# \ / ||||| \ | /
> - ls-4473 0.N.. 0us : preempt_schedule (write_chan)
> - ls-4473 0dN.1 1us : _spin_lock (schedule)
> - ls-4473 0dN.1 2us : add_preempt_count (_spin_lock)
> - ls-4473 0d..2 2us : put_prev_task_fair (schedule)
> -[...]
> - ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts)
> - ls-4473 0d..2 13us : __switch_to (schedule)
> - sshd-4261 0d..2 14us : finish_task_switch (schedule)
> - sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch)
> - sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave)
> - sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set)
> - sshd-4261 0d..2 16us : do_IRQ (common_interrupt)
> - sshd-4261 0d..2 17us : irq_enter (do_IRQ)
> - sshd-4261 0d..2 17us : idle_cpu (irq_enter)
> - sshd-4261 0d..2 18us : add_preempt_count (irq_enter)
> - sshd-4261 0d.h2 18us : idle_cpu (irq_enter)
> - sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ)
> - sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq)
> - sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock)
> - sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq)
> - sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock)
> -[...]
> - sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq)
> - sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock)
> - sshd-4261 0d.h2 29us : irq_exit (do_IRQ)
> - sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit)
> - sshd-4261 0d..3 30us : do_softirq (irq_exit)
> - sshd-4261 0d... 30us : __do_softirq (do_softirq)
> - sshd-4261 0d... 31us : __local_bh_disable (__do_softirq)
> - sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable)
> - sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable)
> -[...]
> - sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip)
> - sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip)
> - sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt)
> - sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt)
> - sshd-4261 0d.s3 45us : idle_cpu (irq_enter)
> - sshd-4261 0d.s3 46us : add_preempt_count (irq_enter)
> - sshd-4261 0d.H3 46us : idle_cpu (irq_enter)
> - sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt)
> - sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt)
> -[...]
> - sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt)
> - sshd-4261 0d.H3 82us : ktime_get (tick_program_event)
> - sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get)
> - sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts)
> - sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts)
> - sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event)
> - sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event)
> - sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt)
> - sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit)
> - sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit)
> - sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable)
> -[...]
> - sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action)
> - sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq)
> - sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq)
> - sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq)
> - sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable)
> - sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq)
> - sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq)
> -
> -
> -This is a very interesting trace. It started with the preemption
> -of the ls task. We see that the task had the "need_resched" bit
> -set via the 'N' in the trace. Interrupts were disabled before
> -the spin_lock at the beginning of the trace. We see that a
> -schedule took place to run sshd. When the interrupts were
> -enabled, we took an interrupt. On return from the interrupt
> -handler, the softirq ran. We took another interrupt while
> -running the softirq as we see from the capital 'H'.
> -
> -
> wakeup
> ------
>
> --
> 1.6.0.6
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* [Qemu-devel] [6736] Sparse fixes: NULL use, header order, ANSI prototypes, static
From: Blue Swirl @ 2009-03-07 15:32 UTC (permalink / raw)
To: qemu-devel
Revision: 6736
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6736
Author: blueswir1
Date: 2009-03-07 15:32:56 +0000 (Sat, 07 Mar 2009)
Log Message:
-----------
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings:
* use NULL instead of plain 0
* rearrange header include order to avoid redefining types accidentally
* ANSIfy SLIRP
* avoid "restrict" keyword
* add static
Modified Paths:
--------------
trunk/block-dmg.c
trunk/block-vmdk.c
trunk/block-vvfat.c
trunk/bt-host.c
trunk/bt-vhci.c
trunk/console.c
trunk/curses.c
trunk/exec.c
trunk/hw/bt-hci.c
trunk/hw/bt-hid.c
trunk/hw/bt-l2cap.c
trunk/hw/bt-sdp.c
trunk/hw/ppce500_mpc8544ds.c
trunk/hw/usb-bt.c
trunk/hw/vmware_vga.c
trunk/hw/wm8750.c
trunk/monitor.c
trunk/net.c
trunk/osdep.c
trunk/savevm.c
trunk/sdl.c
trunk/slirp/if.c
trunk/slirp/ip_icmp.c
trunk/slirp/ip_input.c
trunk/slirp/ip_output.c
trunk/slirp/libslirp.h
trunk/slirp/mbuf.c
trunk/slirp/misc.c
trunk/slirp/sbuf.c
trunk/slirp/slirp.c
trunk/slirp/socket.c
trunk/slirp/tcp_input.c
trunk/slirp/tcp_output.c
trunk/slirp/tcp_subr.c
trunk/vl.c
Modified: trunk/block-dmg.c
===================================================================
--- trunk/block-dmg.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/block-dmg.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -85,7 +85,7 @@
return -errno;
bs->read_only = 1;
s->n_chunks = 0;
- s->offsets = s->lengths = s->sectors = s->sectorcounts = 0;
+ s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL;
/* read offset of info blocks */
if(lseek(s->fd,-0x1d8,SEEK_END)<0) {
Modified: trunk/block-vmdk.c
===================================================================
--- trunk/block-vmdk.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/block-vmdk.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -134,7 +134,7 @@
cid_str_size = sizeof("CID");
}
- if ((p_name = strstr(desc,cid_str)) != 0) {
+ if ((p_name = strstr(desc,cid_str)) != NULL) {
p_name += cid_str_size;
sscanf(p_name,"%x",&cid);
}
@@ -154,7 +154,7 @@
tmp_str = strstr(desc,"parentCID");
pstrcpy(tmp_desc, sizeof(tmp_desc), tmp_str);
- if ((p_name = strstr(desc,"CID")) != 0) {
+ if ((p_name = strstr(desc,"CID")) != NULL) {
p_name += sizeof("CID");
snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid);
pstrcat(desc, sizeof(desc), tmp_desc);
@@ -239,7 +239,7 @@
if (read(p_fd, p_desc, DESC_SIZE) != DESC_SIZE)
goto fail;
- if ((p_name = strstr(p_desc,"CID")) != 0) {
+ if ((p_name = strstr(p_desc,"CID")) != NULL) {
p_name += sizeof("CID");
sscanf(p_name,"%x",&p_cid);
}
@@ -330,12 +330,12 @@
if (bdrv_pread(s->hd, 0x200, desc, DESC_SIZE) != DESC_SIZE)
return -1;
- if ((p_name = strstr(desc,"parentFileNameHint")) != 0) {
+ if ((p_name = strstr(desc,"parentFileNameHint")) != NULL) {
char *end_name;
struct stat file_buf;
p_name += sizeof("parentFileNameHint") + 1;
- if ((end_name = strchr(p_name,'\"')) == 0)
+ if ((end_name = strchr(p_name,'\"')) == NULL)
return -1;
if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1)
return -1;
Modified: trunk/block-vvfat.c
===================================================================
--- trunk/block-vvfat.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/block-vvfat.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -78,7 +78,7 @@
static inline void array_init(array_t* array,unsigned int item_size)
{
- array->pointer=0;
+ array->pointer = NULL;
array->size=0;
array->next=0;
array->item_size=item_size;
@@ -129,7 +129,7 @@
int increment=count*array->item_size;
array->pointer=qemu_realloc(array->pointer,array->size+increment);
if(!array->pointer)
- return 0;
+ return NULL;
array->size+=increment;
}
memmove(array->pointer+(index+count)*array->item_size,
@@ -604,8 +604,8 @@
unsigned int directory_start, const char* filename, int is_dot)
{
int i,j,long_index=s->directory.next;
- direntry_t* entry=0;
- direntry_t* entry_long=0;
+ direntry_t* entry = NULL;
+ direntry_t* entry_long = NULL;
if(is_dot) {
entry=array_get_next(&(s->directory));
@@ -696,7 +696,7 @@
int first_cluster = mapping->begin;
int parent_index = mapping->info.dir.parent_mapping_index;
mapping_t* parent_mapping = (mapping_t*)
- (parent_index >= 0 ? array_get(&(s->mapping), parent_index) : 0);
+ (parent_index >= 0 ? array_get(&(s->mapping), parent_index) : NULL);
int first_cluster_of_parent = parent_mapping ? parent_mapping->begin : -1;
DIR* dir=opendir(dirname);
@@ -1125,10 +1125,10 @@
int index=find_mapping_for_cluster_aux(s,cluster_num,0,s->mapping.next);
mapping_t* mapping;
if(index>=s->mapping.next)
- return 0;
+ return NULL;
mapping=array_get(&(s->mapping),index);
if(mapping->begin>cluster_num)
- return 0;
+ return NULL;
assert(mapping->begin<=cluster_num && mapping->end>cluster_num);
return mapping;
}
Modified: trunk/bt-host.c
===================================================================
--- trunk/bt-host.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/bt-host.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -171,7 +171,7 @@
if (fd < 0) {
fprintf(stderr, "qemu: Can't open `%s': %s (%i)\n",
id, strerror(errno), errno);
- return 0;
+ return NULL;
}
# ifdef CONFIG_BLUEZ
@@ -192,7 +192,7 @@
s->hci.acl_send = bt_host_acl;
s->hci.bdaddr_set = bt_host_bdaddr_set;
- qemu_set_fd_handler2(s->fd, bt_host_read_poll, bt_host_read, 0, s);
+ qemu_set_fd_handler2(s->fd, bt_host_read_poll, bt_host_read, NULL, s);
return &s->hci;
}
Modified: trunk/bt-vhci.c
===================================================================
--- trunk/bt-vhci.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/bt-vhci.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -165,5 +165,5 @@
s->info->evt_recv = vhci_out_hci_packet_event;
s->info->acl_recv = vhci_out_hci_packet_acl;
- qemu_set_fd_handler(s->fd, vhci_read, 0, s);
+ qemu_set_fd_handler(s->fd, vhci_read, NULL, s);
}
Modified: trunk/console.c
===================================================================
--- trunk/console.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/console.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -1327,7 +1327,7 @@
unsigned height;
static int color_inited;
- s = new_console(ds, (p == 0) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
+ s = new_console(ds, (p == NULL) ? TEXT_CONSOLE : TEXT_CONSOLE_FIXED_SIZE);
if (!s) {
free(chr);
return;
@@ -1353,7 +1353,7 @@
s->y = 0;
width = ds_get_width(s->ds);
height = ds_get_height(s->ds);
- if (p != 0) {
+ if (p != NULL) {
width = strtoul(p, (char **)&p, 10);
if (*p == 'C') {
p++;
Modified: trunk/curses.c
===================================================================
--- trunk/curses.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/curses.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,11 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-
-#include "qemu-common.h"
-#include "console.h"
-#include "sysemu.h"
-
#include <curses.h>
#ifndef _WIN32
@@ -38,6 +33,10 @@
#define resize_term resizeterm
#endif
+#include "qemu-common.h"
+#include "console.h"
+#include "sysemu.h"
+
#define FONT_HEIGHT 16
#define FONT_WIDTH 8
Modified: trunk/exec.c
===================================================================
--- trunk/exec.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/exec.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -179,7 +179,7 @@
CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];
void *io_mem_opaque[IO_MEM_NB_ENTRIES];
-char io_mem_used[IO_MEM_NB_ENTRIES];
+static char io_mem_used[IO_MEM_NB_ENTRIES];
static int io_mem_watch;
#endif
Modified: trunk/hw/bt-hci.c
===================================================================
--- trunk/hw/bt-hci.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/bt-hci.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -446,7 +446,7 @@
mask_byte = (evt - 1) >> 3;
mask = 1 << ((evt - 1) & 3);
if (mask & bt_event_reserved_mask[mask_byte] & ~hci->event_mask[mask_byte])
- return 0;
+ return NULL;
packet = hci->evt_packet(hci->opaque);
packet[0] = evt;
@@ -664,7 +664,7 @@
static void bt_hci_lmp_link_teardown(struct bt_hci_s *hci, uint16_t handle)
{
handle &= ~HCI_HANDLE_OFFSET;
- hci->lm.handle[handle].link = 0;
+ hci->lm.handle[handle].link = NULL;
if (bt_hci_role_master(hci, handle)) {
qemu_del_timer(hci->lm.handle[handle].acl_mode_timer);
@@ -1138,7 +1138,7 @@
hci->device.page_scan = 0;
if (hci->device.lmp_name)
qemu_free((void *) hci->device.lmp_name);
- hci->device.lmp_name = 0;
+ hci->device.lmp_name = NULL;
hci->device.class[0] = 0x00;
hci->device.class[1] = 0x00;
hci->device.class[2] = 0x00;
@@ -1617,7 +1617,7 @@
bt_hci_event_status(hci, HCI_SUCCESS);
bt_hci_connection_accept(hci, hci->conn_req_host);
- hci->conn_req_host = 0;
+ hci->conn_req_host = NULL;
break;
case cmd_opcode_pack(OGF_LINK_CTL, OCF_REJECT_CONN_REQ):
@@ -1634,7 +1634,7 @@
bt_hci_connection_reject(hci, hci->conn_req_host,
PARAM(reject_conn_req, reason));
bt_hci_connection_reject_event(hci, &hci->conn_req_host->bd_addr);
- hci->conn_req_host = 0;
+ hci->conn_req_host = NULL;
break;
case cmd_opcode_pack(OGF_LINK_CTL, OCF_AUTH_REQUESTED):
Modified: trunk/hw/bt-hid.c
===================================================================
--- trunk/hw/bt-hid.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/bt-hid.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -324,7 +324,8 @@
break;
}
s->proto = parameter;
- s->usbdev->handle_control(s->usbdev, SET_PROTOCOL, s->proto, 0, 0, 0);
+ s->usbdev->handle_control(s->usbdev, SET_PROTOCOL, s->proto, 0, 0,
+ NULL);
ret = BT_HS_SUCCESSFUL;
break;
@@ -347,7 +348,7 @@
/* We don't need to know about the Idle Rate here really,
* so just pass it on to the device. */
ret = s->usbdev->handle_control(s->usbdev,
- SET_IDLE, data[1], 0, 0, 0) ?
+ SET_IDLE, data[1], 0, 0, NULL) ?
BT_HS_SUCCESSFUL : BT_HS_ERR_INVALID_PARAMETER;
/* XXX: Does this generate a handshake? */
break;
@@ -462,7 +463,7 @@
{
struct bt_hid_device_s *hid = opaque;
- hid->control = 0;
+ hid->control = NULL;
bt_hid_connected_update(hid);
}
@@ -470,7 +471,7 @@
{
struct bt_hid_device_s *hid = opaque;
- hid->interrupt = 0;
+ hid->interrupt = NULL;
bt_hid_connected_update(hid);
}
Modified: trunk/hw/bt-l2cap.c
===================================================================
--- trunk/hw/bt-l2cap.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/bt-l2cap.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -401,7 +401,7 @@
static struct l2cap_chan_s *l2cap_channel_open(struct l2cap_instance_s *l2cap,
int psm, int source_cid)
{
- struct l2cap_chan_s *ch = 0;
+ struct l2cap_chan_s *ch = NULL;
struct bt_l2cap_psm_s *psm_info;
int result, status;
int cid = l2cap_cid_new(l2cap);
@@ -452,7 +452,7 @@
static void l2cap_channel_close(struct l2cap_instance_s *l2cap,
int cid, int source_cid)
{
- struct l2cap_chan_s *ch = 0;
+ struct l2cap_chan_s *ch = NULL;
/* According to Volume 3, section 6.1.1, pg 1048 of BT Core V2.0, a
* connection in CLOSED state still responds with a L2CAP_DisconnectRsp
@@ -472,7 +472,7 @@
return;
}
- l2cap->cid[cid] = 0;
+ l2cap->cid[cid] = NULL;
ch->params.close(ch->params.opaque);
qemu_free(ch);
@@ -484,7 +484,7 @@
static void l2cap_channel_config_null(struct l2cap_instance_s *l2cap,
struct l2cap_chan_s *ch)
{
- l2cap_configuration_request(l2cap, ch->remote_cid, 0, 0, 0);
+ l2cap_configuration_request(l2cap, ch->remote_cid, 0, NULL, 0);
ch->config_req_id = l2cap->last_id;
ch->config &= ~L2CAP_CFG_INIT;
}
Modified: trunk/hw/bt-sdp.c
===================================================================
--- trunk/hw/bt-sdp.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/bt-sdp.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -948,7 +948,7 @@
&sdp_service_sdp_s,
&sdp_service_hid_s,
&sdp_service_pnp_s,
- 0,
+ NULL,
};
sdp->channel = params;
Modified: trunk/hw/ppce500_mpc8544ds.c
===================================================================
--- trunk/hw/ppce500_mpc8544ds.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/ppce500_mpc8544ds.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -47,6 +47,7 @@
#define MPC8544_PCI_IO 0xE1000000
#define MPC8544_PCI_IOLEN 0x10000
+#ifdef HAVE_FDT
static int mpc8544_copy_soc_cell(void *fdt, const char *node, const char *prop)
{
uint32_t cell;
@@ -68,6 +69,7 @@
out:
return ret;
}
+#endif
static void *mpc8544_load_device_tree(void *addr,
uint32_t ramsize,
Modified: trunk/hw/usb-bt.c
===================================================================
--- trunk/hw/usb-bt.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/usb-bt.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -612,9 +612,9 @@
{
struct USBBtState *s = (struct USBBtState *) dev->opaque;
- s->hci->opaque = 0;
- s->hci->evt_recv = 0;
- s->hci->acl_recv = 0;
+ s->hci->opaque = NULL;
+ s->hci->evt_recv = NULL;
+ s->hci->acl_recv = NULL;
qemu_free(s);
}
Modified: trunk/hw/vmware_vga.c
===================================================================
--- trunk/hw/vmware_vga.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/vmware_vga.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -230,7 +230,6 @@
#ifdef VERBOSE
# define GUEST_OS_BASE 0x5001
static const char *vmsvga_guest_id[] = {
- [0x00 ... 0x15] = "an unknown OS",
[0x00] = "Dos",
[0x01] = "Windows 3.1",
[0x02] = "Windows 95",
@@ -240,8 +239,18 @@
[0x06] = "Windows 2000",
[0x07] = "Linux",
[0x08] = "OS/2",
+ [0x09] = "an unknown OS",
[0x0a] = "BSD",
[0x0b] = "Whistler",
+ [0x0c] = "an unknown OS",
+ [0x0d] = "an unknown OS",
+ [0x0e] = "an unknown OS",
+ [0x0f] = "an unknown OS",
+ [0x10] = "an unknown OS",
+ [0x11] = "an unknown OS",
+ [0x12] = "an unknown OS",
+ [0x13] = "an unknown OS",
+ [0x14] = "an unknown OS",
[0x15] = "Windows 2003",
};
#endif
Modified: trunk/hw/wm8750.c
===================================================================
--- trunk/hw/wm8750.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/hw/wm8750.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -184,12 +184,12 @@
for (i = 0; i < IN_PORT_N; i ++)
if (s->adc_voice[i]) {
AUD_close_in(&s->card, s->adc_voice[i]);
- s->adc_voice[i] = 0;
+ s->adc_voice[i] = NULL;
}
for (i = 0; i < OUT_PORT_N; i ++)
if (s->dac_voice[i]) {
AUD_close_out(&s->card, s->dac_voice[i]);
- s->dac_voice[i] = 0;
+ s->dac_voice[i] = NULL;
}
if (!s->enable)
Modified: trunk/monitor.c
===================================================================
--- trunk/monitor.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/monitor.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#include <dirent.h>
#include "hw/hw.h"
#include "hw/usb.h"
#include "hw/pcmcia.h"
@@ -37,7 +38,6 @@
#include "audio/audio.h"
#include "disas.h"
#include "balloon.h"
-#include <dirent.h>
#include "qemu-timer.h"
#include "migration.h"
#include "kvm.h"
Modified: trunk/net.c
===================================================================
--- trunk/net.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/net.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,14 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "qemu-common.h"
-#include "net.h"
-#include "monitor.h"
-#include "sysemu.h"
-#include "qemu-timer.h"
-#include "qemu-char.h"
-#include "audio/audio.h"
-
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
@@ -98,12 +90,6 @@
#endif
#endif
-#include "qemu_socket.h"
-
-#if defined(CONFIG_SLIRP)
-#include "libslirp.h"
-#endif
-
#if defined(__OpenBSD__)
#include <util.h>
#endif
@@ -120,6 +106,20 @@
#define memalign(align, size) malloc(size)
#endif
+#include "qemu-common.h"
+#include "net.h"
+#include "monitor.h"
+#include "sysemu.h"
+#include "qemu-timer.h"
+#include "qemu-char.h"
+#include "audio/audio.h"
+#include "qemu_socket.h"
+
+#if defined(CONFIG_SLIRP)
+#include "libslirp.h"
+#endif
+
+
static VLANState *first_vlan;
/***********************************************************/
@@ -585,7 +585,7 @@
char filename[1024];
/* erase all the files in the directory */
- if ((d = opendir(dir_name)) != 0) {
+ if ((d = opendir(dir_name)) != NULL) {
for(;;) {
de = readdir(d);
if (!de)
@@ -673,7 +673,7 @@
struct VMChannel {
CharDriverState *hd;
int port;
-} *vmchannels;
+};
static int vmchannel_can_read(void *opaque)
{
Modified: trunk/osdep.c
===================================================================
--- trunk/osdep.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/osdep.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -33,9 +33,6 @@
#include <sys/statvfs.h>
#endif
-#include "qemu-common.h"
-#include "sysemu.h"
-
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -45,6 +42,8 @@
#include <malloc.h>
#endif
+#include "qemu-common.h"
+#include "sysemu.h"
#include "qemu_socket.h"
#if defined(_WIN32)
Modified: trunk/savevm.c
===================================================================
--- trunk/savevm.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/savevm.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,18 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "qemu-common.h"
-#include "hw/hw.h"
-#include "net.h"
-#include "monitor.h"
-#include "sysemu.h"
-#include "qemu-timer.h"
-#include "qemu-char.h"
-#include "block.h"
-#include "audio/audio.h"
-#include "migration.h"
-#include "qemu_socket.h"
-
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
@@ -87,6 +75,18 @@
#define memalign(align, size) malloc(size)
#endif
+#include "qemu-common.h"
+#include "hw/hw.h"
+#include "net.h"
+#include "monitor.h"
+#include "sysemu.h"
+#include "qemu-timer.h"
+#include "qemu-char.h"
+#include "block.h"
+#include "audio/audio.h"
+#include "migration.h"
+#include "qemu_socket.h"
+
/* point to the block driver where the snapshots are managed */
static BlockDriverState *bs_snapshots;
Modified: trunk/sdl.c
===================================================================
--- trunk/sdl.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/sdl.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,11 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "qemu-common.h"
-#include "console.h"
-#include "sysemu.h"
-#include "x_keymap.h"
-
#include <SDL.h>
#include <SDL/SDL_syswm.h>
@@ -33,6 +28,11 @@
#include <signal.h>
#endif
+#include "qemu-common.h"
+#include "console.h"
+#include "sysemu.h"
+#include "x_keymap.h"
+
static DisplayChangeListener *dcl;
static SDL_Surface *real_screen;
static SDL_Surface *guest_screen = NULL;
Modified: trunk/slirp/if.c
===================================================================
--- trunk/slirp/if.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/if.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -32,7 +32,7 @@
}
void
-if_init()
+if_init(void)
{
if_fastq.ifq_next = if_fastq.ifq_prev = &if_fastq;
if_batchq.ifq_next = if_batchq.ifq_prev = &if_batchq;
@@ -133,9 +133,7 @@
* it'll temporarily get downgraded to the batchq)
*/
void
-if_output(so, ifm)
- struct socket *so;
- struct mbuf *ifm;
+if_output(struct socket *so, struct mbuf *ifm)
{
struct mbuf *ifq;
int on_fastq = 1;
Modified: trunk/slirp/ip_icmp.c
===================================================================
--- trunk/slirp/ip_icmp.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/ip_icmp.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -68,9 +68,7 @@
* Process a received ICMP message.
*/
void
-icmp_input(m, hlen)
- struct mbuf *m;
- int hlen;
+icmp_input(struct mbuf *m, int hlen)
{
register struct icmp *icp;
register struct ip *ip=mtod(m, struct ip *);
@@ -319,8 +317,7 @@
* Reflect the ip packet back to the source
*/
void
-icmp_reflect(m)
- struct mbuf *m;
+icmp_reflect(struct mbuf *m)
{
register struct ip *ip = mtod(m, struct ip *);
int hlen = ip->ip_hl << 2;
Modified: trunk/slirp/ip_input.c
===================================================================
--- trunk/slirp/ip_input.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/ip_input.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -60,7 +60,7 @@
* All protocols not implemented in kernel go to raw IP protocol handler.
*/
void
-ip_init()
+ip_init(void)
{
ipq.ip_link.next = ipq.ip_link.prev = &ipq.ip_link;
ip_id = tt.tv_sec & 0xffff;
@@ -73,8 +73,7 @@
* try to reassemble. Process options. Pass to next level.
*/
void
-ip_input(m)
- struct mbuf *m;
+ip_input(struct mbuf *m)
{
register struct ip *ip;
int hlen;
@@ -222,7 +221,7 @@
if (ip->ip_tos & 1 || ip->ip_off) {
STAT(ipstat.ips_fragments++);
ip = ip_reass(ip, fp);
- if (ip == 0)
+ if (ip == NULL)
return;
STAT(ipstat.ips_reassembled++);
m = dtom(ip);
@@ -289,7 +288,7 @@
/*
* If first fragment to arrive, create a reassembly queue.
*/
- if (fp == 0) {
+ if (fp == NULL) {
struct mbuf *t;
if ((t = m_get()) == NULL) goto dropfrag;
fp = mtod(t, struct ipq *);
@@ -357,11 +356,11 @@
for (q = fp->frag_link.next; q != (struct ipasfrag*)&fp->frag_link;
q = q->ipf_next) {
if (q->ipf_off != next)
- return (0);
+ return NULL;
next += q->ipf_len;
}
if (((struct ipasfrag *)(q->ipf_prev))->ipf_tos & 1)
- return (0);
+ return NULL;
/*
* Reassembly is complete; concatenate fragments.
@@ -414,7 +413,7 @@
dropfrag:
STAT(ipstat.ips_fragdropped++);
m_freem(m);
- return (0);
+ return NULL;
}
/*
@@ -466,7 +465,7 @@
* queue, discard it.
*/
void
-ip_slowtimo()
+ip_slowtimo(void)
{
struct qlink *l;
@@ -474,7 +473,7 @@
l = ipq.ip_link.next;
- if (l == 0)
+ if (l == NULL)
return;
while (l != &ipq.ip_link) {
@@ -702,9 +701,7 @@
* (XXX) should be deleted; last arg currently ignored.
*/
void
-ip_stripoptions(m, mopt)
- register struct mbuf *m;
- struct mbuf *mopt;
+ip_stripoptions(register struct mbuf *m, struct mbuf *mopt)
{
register int i;
struct ip *ip = mtod(m, struct ip *);
Modified: trunk/slirp/ip_output.c
===================================================================
--- trunk/slirp/ip_output.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/ip_output.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -53,9 +53,7 @@
* The mbuf opt, if present, will not be freed.
*/
int
-ip_output(so, m0)
- struct socket *so;
- struct mbuf *m0;
+ip_output(struct socket *so, struct mbuf *m0)
{
register struct ip *ip;
register struct mbuf *m = m0;
@@ -135,7 +133,7 @@
for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
register struct ip *mhip;
m = m_get();
- if (m == 0) {
+ if (m == NULL) {
error = -1;
STAT(ipstat.ips_odropped++);
goto sendorfree;
@@ -185,7 +183,7 @@
sendorfree:
for (m = m0; m; m = m0) {
m0 = m->m_nextpkt;
- m->m_nextpkt = 0;
+ m->m_nextpkt = NULL;
if (error == 0)
if_output(so, m);
else
Modified: trunk/slirp/libslirp.h
===================================================================
--- trunk/slirp/libslirp.h 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/libslirp.h 2009-03-07 15:32:56 UTC (rev 6736)
@@ -5,7 +5,7 @@
extern "C" {
#endif
-void slirp_init(int restrict, char *special_ip);
+void slirp_init(int restricted, char *special_ip);
void slirp_select_fill(int *pnfds,
fd_set *readfds, fd_set *writefds, fd_set *xfds);
Modified: trunk/slirp/mbuf.c
===================================================================
--- trunk/slirp/mbuf.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/mbuf.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -29,7 +29,7 @@
#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + sizeof(struct m_hdr ) + 6)
void
-m_init()
+m_init(void)
{
m_freelist.m_next = m_freelist.m_prev = &m_freelist;
m_usedlist.m_next = m_usedlist.m_prev = &m_usedlist;
@@ -44,7 +44,7 @@
* which tells m_free to actually free() it
*/
struct mbuf *
-m_get()
+m_get(void)
{
register struct mbuf *m;
int flags = 0;
@@ -72,16 +72,15 @@
m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);
m->m_data = m->m_dat;
m->m_len = 0;
- m->m_nextpkt = 0;
- m->m_prevpkt = 0;
+ m->m_nextpkt = NULL;
+ m->m_prevpkt = NULL;
end_error:
DEBUG_ARG("m = %lx", (long )m);
return m;
}
void
-m_free(m)
- struct mbuf *m;
+m_free(struct mbuf *m)
{
DEBUG_CALL("m_free");
@@ -115,8 +114,7 @@
* an M_EXT data segment
*/
void
-m_cat(m, n)
- register struct mbuf *m, *n;
+m_cat(struct mbuf *m, struct mbuf *n)
{
/*
* If there's no room, realloc
@@ -133,9 +131,7 @@
/* make m size bytes large */
void
-m_inc(m, size)
- struct mbuf *m;
- int size;
+m_inc(struct mbuf *m, int size)
{
int datasize;
@@ -170,9 +166,7 @@
void
-m_adj(m, len)
- struct mbuf *m;
- int len;
+m_adj(struct mbuf *m, int len)
{
if (m == NULL)
return;
@@ -192,9 +186,7 @@
* Copy len bytes from m, starting off bytes into n
*/
int
-m_copy(n, m, off, len)
- struct mbuf *n, *m;
- int off, len;
+m_copy(struct mbuf *n, struct mbuf *m, int off, int len)
{
if (len > M_FREEROOM(n))
return -1;
@@ -211,8 +203,7 @@
* Fortunately, it's not used often
*/
struct mbuf *
-dtom(dat)
- void *dat;
+dtom(void *dat)
{
struct mbuf *m;
Modified: trunk/slirp/misc.c
===================================================================
--- trunk/slirp/misc.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/misc.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -70,7 +70,7 @@
* Get our IP address and put it in our_addr
*/
void
-getouraddr()
+getouraddr(void)
{
char buff[256];
struct hostent *he = NULL;
@@ -89,8 +89,7 @@
};
inline void
-insque(a, b)
- void *a, *b;
+insque(void *a, void *b)
{
register struct quehead *element = (struct quehead *) a;
register struct quehead *head = (struct quehead *) b;
@@ -102,8 +101,7 @@
}
inline void
-remque(a)
- void *a;
+remque(void *a)
{
register struct quehead *element = (struct quehead *) a;
((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
@@ -116,12 +114,7 @@
int
-add_exec(ex_ptr, do_pty, exec, addr, port)
- struct ex_list **ex_ptr;
- int do_pty;
- char *exec;
- int addr;
- int port;
+add_exec(struct ex_list **ex_ptr, int do_pty, char *exec, int addr, int port)
{
struct ex_list *tmp_ptr;
@@ -363,7 +356,7 @@
argv[i++] = strdup(curarg);
} while (c);
- argv[i] = 0;
+ argv[i] = NULL;
execvp(argv[0], (char **)argv);
/* Ooops, failed, let's tell the user why */
@@ -402,9 +395,9 @@
fd_nonblock(so->s);
/* Append the telnet options now */
- if (so->so_m != 0 && do_pty == 1) {
+ if (so->so_m != NULL && do_pty == 1) {
sbappend(so, so->so_m);
- so->so_m = 0;
+ so->so_m = NULL;
}
return 1;
@@ -764,8 +757,7 @@
#endif
void
-u_sleep(usec)
- int usec;
+u_sleep(int usec)
{
struct timeval t;
fd_set fdset;
@@ -783,8 +775,7 @@
*/
void
-fd_nonblock(fd)
- int fd;
+fd_nonblock(int fd)
{
#ifdef FIONBIO
int opt = 1;
@@ -800,8 +791,7 @@
}
void
-fd_block(fd)
- int fd;
+fd_block(int fd)
{
#ifdef FIONBIO
int opt = 0;
Modified: trunk/slirp/sbuf.c
===================================================================
--- trunk/slirp/sbuf.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/sbuf.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -18,16 +18,13 @@
*/
void
-sbfree(sb)
- struct sbuf *sb;
+sbfree(struct sbuf *sb)
{
free(sb->sb_data);
}
void
-sbdrop(sb, num)
- struct sbuf *sb;
- int num;
+sbdrop(struct sbuf *sb, int num)
{
/*
* We can only drop how much we have
@@ -43,9 +40,7 @@
}
void
-sbreserve(sb, size)
- struct sbuf *sb;
- int size;
+sbreserve(struct sbuf *sb, int size)
{
if (sb->sb_data) {
/* Already alloced, realloc if necessary */
@@ -74,9 +69,7 @@
* (the socket is non-blocking, so we won't hang)
*/
void
-sbappend(so, m)
- struct socket *so;
- struct mbuf *m;
+sbappend(struct socket *so, struct mbuf *m)
{
int ret = 0;
@@ -173,11 +166,7 @@
* done in sbdrop when the data is acked
*/
void
-sbcopy(sb, off, len, to)
- struct sbuf *sb;
- int off;
- int len;
- char *to;
+sbcopy(struct sbuf *sb, int off, int len, char *to)
{
char *from;
Modified: trunk/slirp/slirp.c
===================================================================
--- trunk/slirp/slirp.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/slirp.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -50,7 +50,7 @@
const char *slirp_special_ip = CTL_SPECIAL;
int slirp_restrict;
-int do_slowtimo;
+static int do_slowtimo;
int link_up;
struct timeval tt;
FILE *lfd;
@@ -171,7 +171,7 @@
static void slirp_state_save(QEMUFile *f, void *opaque);
static int slirp_state_load(QEMUFile *f, void *opaque, int version_id);
-void slirp_init(int restrict, char *special_ip)
+void slirp_init(int restricted, char *special_ip)
{
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
@@ -184,7 +184,7 @@
#endif
link_up = 1;
- slirp_restrict = restrict;
+ slirp_restrict = restricted;
if_init();
ip_init();
@@ -228,7 +228,7 @@
#else
static void updtime(void)
{
- gettimeofday(&tt, 0);
+ gettimeofday(&tt, NULL);
curtime = (u_int)tt.tv_sec * (u_int)1000;
curtime += (u_int)tt.tv_usec / (u_int)1000;
Modified: trunk/slirp/socket.c
===================================================================
--- trunk/slirp/socket.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/socket.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -25,12 +25,8 @@
#endif
struct socket *
-solookup(head, laddr, lport, faddr, fport)
- struct socket *head;
- struct in_addr laddr;
- u_int lport;
- struct in_addr faddr;
- u_int fport;
+solookup(struct socket *head, struct in_addr laddr, u_int lport,
+ struct in_addr faddr, u_int fport)
{
struct socket *so;
@@ -54,7 +50,7 @@
* insque() it into the correct linked-list
*/
struct socket *
-socreate()
+socreate(void)
{
struct socket *so;
@@ -71,8 +67,7 @@
* remque and free a socket, clobber cache
*/
void
-sofree(so)
- struct socket *so;
+sofree(struct socket *so)
{
if (so->so_emu==EMU_RSH && so->extra) {
sofree(so->extra);
@@ -158,8 +153,7 @@
* a read() of 0 (or less) means it's disconnected
*/
int
-soread(so)
- struct socket *so;
+soread(struct socket *so)
{
int n, nn;
struct sbuf *sb = &so->so_snd;
@@ -269,8 +263,7 @@
* in the send buffer is sent as urgent data
*/
void
-sorecvoob(so)
- struct socket *so;
+sorecvoob(struct socket *so)
{
struct tcpcb *tp = sototcpcb(so);
@@ -297,8 +290,7 @@
* There's a lot duplicated code here, but...
*/
int
-sosendoob(so)
- struct socket *so;
+sosendoob(struct socket *so)
{
struct sbuf *sb = &so->so_rcv;
char buff[2048]; /* XXX Shouldn't be sending more oob data than this */
@@ -356,8 +348,7 @@
* updating all sbuf field as necessary
*/
int
-sowrite(so)
- struct socket *so;
+sowrite(struct socket *so)
{
int n,nn;
struct sbuf *sb = &so->so_rcv;
@@ -451,8 +442,7 @@
* recvfrom() a UDP socket
*/
void
-sorecvfrom(so)
- struct socket *so;
+sorecvfrom(struct socket *so)
{
struct sockaddr_in addr;
socklen_t addrlen = sizeof(struct sockaddr_in);
@@ -479,7 +469,7 @@
icmp_error(so->so_m, ICMP_UNREACH,code, 0,strerror(errno));
} else {
icmp_reflect(so->so_m);
- so->so_m = 0; /* Don't m_free() it again! */
+ so->so_m = NULL; /* Don't m_free() it again! */
}
/* No need for this socket anymore, udp_detach it */
udp_detach(so);
@@ -551,9 +541,7 @@
* sendto() a socket
*/
int
-sosendto(so, m)
- struct socket *so;
- struct mbuf *m;
+sosendto(struct socket *so, struct mbuf *m)
{
int ret;
struct sockaddr_in addr;
@@ -600,11 +588,7 @@
* XXX This should really be tcp_listen
*/
struct socket *
-solisten(port, laddr, lport, flags)
- u_int port;
- u_int32_t laddr;
- u_int lport;
- int flags;
+solisten(u_int port, u_int32_t laddr, u_int lport, int flags)
{
struct sockaddr_in addr;
struct socket *so;
@@ -706,8 +690,7 @@
* times each when only 1 was needed
*/
void
-soisfconnecting(so)
- register struct socket *so;
+soisfconnecting(struct socket *so)
{
so->so_state &= ~(SS_NOFDREF|SS_ISFCONNECTED|SS_FCANTRCVMORE|
SS_FCANTSENDMORE|SS_FWDRAIN);
@@ -715,8 +698,7 @@
}
void
-soisfconnected(so)
- register struct socket *so;
+soisfconnected(struct socket *so)
{
so->so_state &= ~(SS_ISFCONNECTING|SS_FWDRAIN|SS_NOFDREF);
so->so_state |= SS_ISFCONNECTED; /* Clobber other states */
@@ -758,8 +740,7 @@
}
void
-soisfdisconnected(so)
- struct socket *so;
+soisfdisconnected(struct socket *so)
{
/* so->so_state &= ~(SS_ISFCONNECTING|SS_ISFCONNECTED); */
/* close(so->s); */
@@ -774,8 +755,7 @@
* Set CANTSENDMORE once all data has been write()n
*/
void
-sofwdrain(so)
- struct socket *so;
+sofwdrain(struct socket *so)
{
if (so->so_rcv.sb_cc)
so->so_state |= SS_FWDRAIN;
Modified: trunk/slirp/tcp_input.c
===================================================================
--- trunk/slirp/tcp_input.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/tcp_input.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -121,10 +121,10 @@
int flags;
/*
- * Call with ti==0 after become established to
+ * Call with ti==NULL after become established to
* force pre-ESTABLISHED data up to user socket.
*/
- if (ti == 0)
+ if (ti == NULL)
goto present;
/*
@@ -230,19 +230,16 @@
* protocol specification dated September, 1981 very closely.
*/
void
-tcp_input(m, iphlen, inso)
- register struct mbuf *m;
- int iphlen;
- struct socket *inso;
+tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
{
struct ip save_ip, *ip;
register struct tcpiphdr *ti;
caddr_t optp = NULL;
int optlen = 0;
int len, tlen, off;
- register struct tcpcb *tp = 0;
+ register struct tcpcb *tp = NULL;
register int tiflags;
- struct socket *so = 0;
+ struct socket *so = NULL;
int todrop, acked, ourfinisacked, needoutput = 0;
/* int dropsocket = 0; */
int iss = 0;
@@ -264,7 +261,7 @@
/* Re-set a few variables */
tp = sototcpcb(so);
m = so->so_m;
- so->so_m = 0;
+ so->so_m = NULL;
ti = so->so_ti;
tiwin = ti->ti_win;
tiflags = ti->ti_flags;
@@ -298,8 +295,8 @@
* Checksum extended TCP header and data.
*/
tlen = ((struct ip *)ti)->ip_len;
- tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = 0;
- memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
+ tcpiphdr2qlink(ti)->next = tcpiphdr2qlink(ti)->prev = NULL;
+ memset(&ti->ti_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));
ti->ti_x1 = 0;
ti->ti_len = htons((u_int16_t)tlen);
len = sizeof(struct ip ) + tlen;
@@ -399,7 +396,7 @@
* the only flag set, then create a session, mark it
* as if it was LISTENING, and continue...
*/
- if (so == 0) {
+ if (so == NULL) {
if ((tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) != TH_SYN)
goto dropwithreset;
@@ -439,7 +436,7 @@
tp = sototcpcb(so);
/* XXX Should never fail */
- if (tp == 0)
+ if (tp == NULL)
goto dropwithreset;
if (tp->t_state == TCPS_CLOSED)
goto drop;
@@ -1697,9 +1694,7 @@
*/
int
-tcp_mss(tp, offer)
- register struct tcpcb *tp;
- u_int offer;
+tcp_mss(struct tcpcb *tp, u_int offer)
{
struct socket *so = tp->t_socket;
int mss;
Modified: trunk/slirp/tcp_output.c
===================================================================
--- trunk/slirp/tcp_output.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/tcp_output.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -64,8 +64,7 @@
* Tcp output routine: figure out what should be sent and send it.
*/
int
-tcp_output(tp)
- register struct tcpcb *tp;
+tcp_output(struct tcpcb *tp)
{
register struct socket *so = tp->t_socket;
register long len, win;
@@ -582,8 +581,7 @@
}
void
-tcp_setpersist(tp)
- register struct tcpcb *tp;
+tcp_setpersist(struct tcpcb *tp)
{
int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
Modified: trunk/slirp/tcp_subr.c
===================================================================
--- trunk/slirp/tcp_subr.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/slirp/tcp_subr.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -49,7 +49,7 @@
* Tcp initialization
*/
void
-tcp_init()
+tcp_init(void)
{
tcp_iss = 1; /* wrong */
tcb.so_next = tcb.so_prev = &tcb;
@@ -63,8 +63,7 @@
*/
/* struct tcpiphdr * */
void
-tcp_template(tp)
- struct tcpcb *tp;
+tcp_template(struct tcpcb *tp)
{
struct socket *so = tp->t_socket;
register struct tcpiphdr *n = &tp->t_template;
@@ -102,12 +101,8 @@
* segment are as specified by the parameters.
*/
void
-tcp_respond(tp, ti, m, ack, seq, flags)
- struct tcpcb *tp;
- register struct tcpiphdr *ti;
- register struct mbuf *m;
- tcp_seq ack, seq;
- int flags;
+tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
+ tcp_seq ack, tcp_seq seq, int flags)
{
register int tlen;
int win = 0;
@@ -122,7 +117,7 @@
if (tp)
win = sbspace(&tp->t_socket->so_rcv);
- if (m == 0) {
+ if (m == NULL) {
if ((m = m_get()) == NULL)
return;
#ifdef TCP_COMPAT_42
@@ -152,7 +147,7 @@
tlen += sizeof (struct tcpiphdr);
m->m_len = tlen;
- ti->ti_mbuf = 0;
+ ti->ti_mbuf = NULL;
ti->ti_x1 = 0;
ti->ti_seq = htonl(seq);
ti->ti_ack = htonl(ack);
@@ -182,8 +177,7 @@
* protocol control block.
*/
struct tcpcb *
-tcp_newtcpcb(so)
- struct socket *so;
+tcp_newtcpcb(struct socket *so)
{
register struct tcpcb *tp;
@@ -257,8 +251,7 @@
* wake up any sleepers
*/
struct tcpcb *
-tcp_close(tp)
- register struct tcpcb *tp;
+tcp_close(struct tcpcb *tp)
{
register struct tcpiphdr *t;
struct socket *so = tp->t_socket;
@@ -281,7 +274,7 @@
*/
/* free(tp, M_PCB); */
free(tp);
- so->so_tcpcb = 0;
+ so->so_tcpcb = NULL;
soisfdisconnected(so);
/* clobber input socket cache if we're closing the cached connection */
if (so == tcp_last_so)
@@ -333,8 +326,7 @@
* We can let the user exit from the close as soon as the FIN is acked.
*/
void
-tcp_sockclosed(tp)
- struct tcpcb *tp;
+tcp_sockclosed(struct tcpcb *tp)
{
DEBUG_CALL("tcp_sockclosed");
@@ -375,8 +367,7 @@
* nonblocking. Connect returns after the SYN is sent, and does
* not wait for ACK+SYN.
*/
-int tcp_fconnect(so)
- struct socket *so;
+int tcp_fconnect(struct socket *so)
{
int ret=0;
@@ -438,8 +429,7 @@
* here and SYN the local-host.
*/
void
-tcp_connect(inso)
- struct socket *inso;
+tcp_connect(struct socket *inso)
{
struct socket *so;
struct sockaddr_in addr;
@@ -525,8 +515,7 @@
* Attach a TCPCB to a socket.
*/
int
-tcp_attach(so)
- struct socket *so;
+tcp_attach(struct socket *so)
{
if ((so->so_tcpcb = tcp_newtcpcb(so)) == NULL)
return -1;
@@ -558,14 +547,13 @@
#ifdef CONFIG_QEMU
static
#endif
-struct emu_t *tcpemu = 0;
+struct emu_t *tcpemu = NULL;
/*
* Return TOS according to the above table
*/
u_int8_t
-tcp_tos(so)
- struct socket *so;
+tcp_tos(struct socket *so)
{
int i = 0;
struct emu_t *emup;
@@ -620,9 +608,7 @@
* NOTE: if you return 0 you MUST m_free() the mbuf!
*/
int
-tcp_emu(so, m)
- struct socket *so;
- struct mbuf *m;
+tcp_emu(struct socket *so, struct mbuf *m)
{
u_int n1, n2, n3, n4, n5, n6;
char buff[257];
@@ -976,7 +962,7 @@
}
#endif
case EMU_FTP: /* ftp */
- *(m->m_data+m->m_len) = 0; /* NULL terminate for strstr */
+ *(m->m_data+m->m_len) = 0; /* NUL terminate for strstr */
if ((bptr = (char *)strstr(m->m_data, "ORT")) != NULL) {
/*
* Need to emulate the PORT command
@@ -1244,8 +1230,7 @@
* return 2 if this is a command-line connection
*/
int
-tcp_ctl(so)
- struct socket *so;
+tcp_ctl(struct socket *so)
{
struct sbuf *sb = &so->so_snd;
int command;
Modified: trunk/vl.c
===================================================================
--- trunk/vl.c 2009-03-07 15:24:59 UTC (rev 6735)
+++ trunk/vl.c 2009-03-07 15:32:56 UTC (rev 6736)
@@ -21,29 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#include "hw/hw.h"
-#include "hw/boards.h"
-#include "hw/usb.h"
-#include "hw/pcmcia.h"
-#include "hw/pc.h"
-#include "hw/audiodev.h"
-#include "hw/isa.h"
-#include "hw/baum.h"
-#include "hw/bt.h"
-#include "net.h"
-#include "monitor.h"
-#include "console.h"
-#include "sysemu.h"
-#include "gdbstub.h"
-#include "qemu-timer.h"
-#include "qemu-char.h"
-#include "cache-utils.h"
-#include "block.h"
-#include "audio/audio.h"
-#include "migration.h"
-#include "kvm.h"
-#include "balloon.h"
-
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
@@ -114,12 +91,6 @@
#endif
#endif
-#include "qemu_socket.h"
-
-#if defined(CONFIG_SLIRP)
-#include "libslirp.h"
-#endif
-
#if defined(__OpenBSD__)
#include <util.h>
#endif
@@ -154,10 +125,39 @@
#define main qemu_main
#endif /* CONFIG_COCOA */
+#include "hw/hw.h"
+#include "hw/boards.h"
+#include "hw/usb.h"
+#include "hw/pcmcia.h"
+#include "hw/pc.h"
+#include "hw/audiodev.h"
+#include "hw/isa.h"
+#include "hw/baum.h"
+#include "hw/bt.h"
+#include "net.h"
+#include "monitor.h"
+#include "console.h"
+#include "sysemu.h"
+#include "gdbstub.h"
+#include "qemu-timer.h"
+#include "qemu-char.h"
+#include "cache-utils.h"
+#include "block.h"
+#include "audio/audio.h"
+#include "migration.h"
+#include "kvm.h"
+#include "balloon.h"
+
#include "disas.h"
#include "exec-all.h"
+#include "qemu_socket.h"
+
+#if defined(CONFIG_SLIRP)
+#include "libslirp.h"
+#endif
+
//#define DEBUG_UNUSED_IOPORT
//#define DEBUG_IOPORT
//#define DEBUG_NET
^ permalink raw reply
* Re: [TIP][RFC 4/7] futex: finish_futex_lock_pi()
From: Thomas Gleixner @ 2009-03-07 15:30 UTC (permalink / raw)
To: Darren Hart; +Cc: lkml, , Steven Rostedt, Sripathi Kodi, John Stultz
In-Reply-To: <49AC7683.3080503@us.ibm.com>
On Mon, 2 Mar 2009, Darren Hart wrote:
> + } else {
> + /* dvhart FIXME: can't we just BUG_ON in this case?
No. There is no reason to crash the kernel if this happens. All what
happens is that a userspace application becomes a bit unhappy.
I did not put a WARN_ON there as the stack trace is known, but we
could do a WARN to trigger the kerneloops detector.
> + * Paranoia check. If we did not take the lock in the trylock
> + * above, then we should not be the owner of the rtmutex,
> + * neither the real nor the pending one:
> + */
> + if (rt_mutex_owner(&q->pi_state->pi_mutex) == current)
> + printk(KERN_ERR "finish_futex_lock_pi: "
> + "ret = %d pi-mutex: %p "
> + "pi-state %p\n", ret,
> + q->pi_state->pi_mutex.owner,
> + q->pi_state->owner);
> + }
Thanks,
tglx
^ permalink raw reply
* [U-Boot] Request to remove my email address from yourU_boot email list
From: Chang Ming @ 2009-03-07 15:30 UTC (permalink / raw)
To: u-boot
Hi, Sir,
?
please remove my email address from your email address, and thanks!
?
?
Best Regards,
Leeming
New Email names for you!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/sg/
^ permalink raw reply
* [Qemu-devel] [6735] The _exit syscall is used for both thread termination in NPTL applications ,
From: Paul Brook @ 2009-03-07 15:25 UTC (permalink / raw)
To: qemu-devel
Revision: 6735
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6735
Author: pbrook
Date: 2009-03-07 15:24:59 +0000 (Sat, 07 Mar 2009)
Log Message:
-----------
The _exit syscall is used for both thread termination in NPTL applications,
and process termination in legacy applications. Try to guess which we want
based on the presence of multiple threads.
Also implement locking when modifying the CPU list.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Modified Paths:
--------------
trunk/cpu-defs.h
trunk/exec.c
trunk/linux-user/main.c
trunk/linux-user/qemu.h
trunk/linux-user/signal.c
trunk/linux-user/syscall.c
trunk/target-alpha/cpu.h
trunk/target-arm/cpu.h
trunk/target-cris/cpu.h
trunk/target-i386/cpu.h
trunk/target-m68k/cpu.h
trunk/target-mips/cpu.h
trunk/target-ppc/cpu.h
trunk/target-sh4/cpu.h
trunk/target-sparc/cpu.h
Modified: trunk/cpu-defs.h
===================================================================
--- trunk/cpu-defs.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/cpu-defs.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -203,7 +203,7 @@
jmp_buf jmp_env; \
int exception_index; \
\
- void *next_cpu; /* next CPU sharing TB cache */ \
+ CPUState *next_cpu; /* next CPU sharing TB cache */ \
int cpu_index; /* CPU index (informative) */ \
int running; /* Nonzero if cpu is currently running(usermode). */ \
/* user data */ \
Modified: trunk/exec.c
===================================================================
--- trunk/exec.c 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/exec.c 2009-03-07 15:24:59 UTC (rev 6735)
@@ -534,6 +534,9 @@
CPUState **penv;
int cpu_index;
+#if defined(CONFIG_USER_ONLY)
+ cpu_list_lock();
+#endif
env->next_cpu = NULL;
penv = &first_cpu;
cpu_index = 0;
@@ -545,6 +548,9 @@
TAILQ_INIT(&env->breakpoints);
TAILQ_INIT(&env->watchpoints);
*penv = env;
+#if defined(CONFIG_USER_ONLY)
+ cpu_list_unlock();
+#endif
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
register_savevm("cpu_common", cpu_index, CPU_COMMON_SAVE_VERSION,
cpu_common_save, cpu_common_load, env);
Modified: trunk/linux-user/main.c
===================================================================
--- trunk/linux-user/main.c 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/linux-user/main.c 2009-03-07 15:24:59 UTC (rev 6735)
@@ -143,6 +143,7 @@
We don't require a full sync, only that no cpus are executing guest code.
The alternative is to map target atomic ops onto host equivalents,
which requires quite a lot of per host/target work. */
+static pthread_mutex_t cpu_list_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t exclusive_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t exclusive_cond = PTHREAD_COND_INITIALIZER;
static pthread_cond_t exclusive_resume = PTHREAD_COND_INITIALIZER;
@@ -165,6 +166,7 @@
thread_env->next_cpu = NULL;
pending_cpus = 0;
pthread_mutex_init(&exclusive_lock, NULL);
+ pthread_mutex_init(&cpu_list_mutex, NULL);
pthread_cond_init(&exclusive_cond, NULL);
pthread_cond_init(&exclusive_resume, NULL);
pthread_mutex_init(&tb_lock, NULL);
@@ -237,6 +239,16 @@
exclusive_idle();
pthread_mutex_unlock(&exclusive_lock);
}
+
+void cpu_list_lock(void)
+{
+ pthread_mutex_lock(&cpu_list_mutex);
+}
+
+void cpu_list_unlock(void)
+{
+ pthread_mutex_unlock(&cpu_list_mutex);
+}
#else /* if !USE_NPTL */
/* These are no-ops because we are not threadsafe. */
static inline void cpu_exec_start(CPUState *env)
@@ -265,6 +277,14 @@
gdbserver_fork(thread_env);
}
}
+
+void cpu_list_lock(void)
+{
+}
+
+void cpu_list_unlock(void)
+{
+}
#endif
Modified: trunk/linux-user/qemu.h
===================================================================
--- trunk/linux-user/qemu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/linux-user/qemu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -100,6 +100,9 @@
uint32_t v86flags;
uint32_t v86mask;
#endif
+#ifdef USE_NPTL
+ abi_ulong child_tidptr;
+#endif
#ifdef TARGET_M68K
int sim_syscalls;
#endif
@@ -225,6 +228,8 @@
extern unsigned long last_brk;
void mmap_lock(void);
void mmap_unlock(void);
+void cpu_list_lock(void);
+void cpu_list_unlock(void);
#if defined(USE_NPTL)
void mmap_fork_start(void);
void mmap_fork_end(int child);
Modified: trunk/linux-user/signal.c
===================================================================
--- trunk/linux-user/signal.c 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/linux-user/signal.c 2009-03-07 15:24:59 UTC (rev 6735)
@@ -2691,7 +2691,7 @@
return err;
}
-static int restore_sigcontext(struct CPUState *regs,
+static int restore_sigcontext(CPUState *regs,
struct target_sigcontext *sc)
{
unsigned int err = 0;
Modified: trunk/linux-user/syscall.c
===================================================================
--- trunk/linux-user/syscall.c 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/linux-user/syscall.c 2009-03-07 15:24:59 UTC (rev 6735)
@@ -156,7 +156,6 @@
}
-#define __NR_sys_exit __NR_exit
#define __NR_sys_uname __NR_uname
#define __NR_sys_faccessat __NR_faccessat
#define __NR_sys_fchmodat __NR_fchmodat
@@ -198,7 +197,6 @@
return -ENOSYS;
}
#endif
-_syscall1(int,sys_exit,int,status)
_syscall1(int,sys_uname,struct new_utsname *,buf)
#if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
_syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags)
@@ -2936,7 +2934,10 @@
nptl_flags = flags;
flags &= ~CLONE_NPTL_FLAGS2;
- /* TODO: Implement CLONE_CHILD_CLEARTID. */
+ if (nptl_flags & CLONE_CHILD_CLEARTID) {
+ ts->child_tidptr = child_tidptr;
+ }
+
if (nptl_flags & CLONE_SETTLS)
cpu_set_tls (new_env, newtls);
@@ -2961,6 +2962,7 @@
sigprocmask(SIG_BLOCK, &sigmask, &info.sigmask);
ret = pthread_create(&info.thread, &attr, clone_func, &info);
+ /* TODO: Free new CPU state if thread creation failed. */
sigprocmask(SIG_SETMASK, &info.sigmask, NULL);
pthread_attr_destroy(&attr);
@@ -3011,7 +3013,8 @@
ts = (TaskState *)env->opaque;
if (flags & CLONE_SETTLS)
cpu_set_tls (env, newtls);
- /* TODO: Implement CLONE_CHILD_CLEARTID. */
+ if (flags & CLONE_CHILD_CLEARTID)
+ ts->child_tidptr = child_tidptr;
#endif
} else {
fork_end(0);
@@ -3428,12 +3431,46 @@
switch(num) {
case TARGET_NR_exit:
+#ifdef USE_NPTL
+ /* In old applications this may be used to implement _exit(2).
+ However in threaded applictions it is used for thread termination,
+ and _exit_group is used for application termination.
+ Do thread termination if we have more then one thread. */
+ /* FIXME: This probably breaks if a signal arrives. We should probably
+ be disabling signals. */
+ if (first_cpu->next_cpu) {
+ CPUState **lastp;
+ CPUState *p;
+
+ cpu_list_lock();
+ lastp = &first_cpu;
+ p = first_cpu;
+ while (p && p != (CPUState *)cpu_env) {
+ lastp = &p->next_cpu;
+ p = p->next_cpu;
+ }
+ /* If we didn't find the CPU for this thread then something is
+ horribly wrong. */
+ if (!p)
+ abort();
+ /* Remove the CPU from the list. */
+ *lastp = p->next_cpu;
+ cpu_list_unlock();
+ TaskState *ts = ((CPUState *)cpu_env)->opaque;
+ if (ts->child_tidptr) {
+ put_user_u32(0, ts->child_tidptr);
+ sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
+ NULL, NULL, 0);
+ }
+ /* TODO: Free CPU state. */
+ pthread_exit(NULL);
+ }
+#endif
#ifdef HAVE_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
- /* XXX: should free thread stack and CPU env */
- sys_exit(arg1);
+ _exit(arg1);
ret = 0; /* avoid warning */
break;
case TARGET_NR_read:
Modified: trunk/target-alpha/cpu.h
===================================================================
--- trunk/target-alpha/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-alpha/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -25,6 +25,8 @@
#define TARGET_LONG_BITS 64
+#define CPUState struct CPUAlphaState
+
#include "cpu-defs.h"
#include <setjmp.h>
@@ -291,7 +293,6 @@
pal_handler_t *pal_handler;
};
-#define CPUState CPUAlphaState
#define cpu_init cpu_alpha_init
#define cpu_exec cpu_alpha_exec
#define cpu_gen_code cpu_alpha_gen_code
Modified: trunk/target-arm/cpu.h
===================================================================
--- trunk/target-arm/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-arm/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -24,6 +24,8 @@
#define ELF_MACHINE EM_ARM
+#define CPUState struct CPUARMState
+
#include "cpu-defs.h"
#include "softfloat.h"
@@ -398,7 +400,6 @@
#define TARGET_PAGE_BITS 10
#endif
-#define CPUState CPUARMState
#define cpu_init cpu_arm_init
#define cpu_exec cpu_arm_exec
#define cpu_gen_code cpu_arm_gen_code
Modified: trunk/target-cris/cpu.h
===================================================================
--- trunk/target-cris/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-cris/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -23,6 +23,8 @@
#define TARGET_LONG_BITS 32
+#define CPUState struct CPUCRISState
+
#include "cpu-defs.h"
#define TARGET_HAS_ICE 1
@@ -199,7 +201,6 @@
#define TARGET_PAGE_BITS 13
#define MMAP_SHIFT TARGET_PAGE_BITS
-#define CPUState CPUCRISState
#define cpu_init cpu_cris_init
#define cpu_exec cpu_cris_exec
#define cpu_gen_code cpu_cris_gen_code
Modified: trunk/target-i386/cpu.h
===================================================================
--- trunk/target-i386/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-i386/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -42,6 +42,8 @@
#define ELF_MACHINE EM_386
#endif
+#define CPUState struct CPUX86State
+
#include "cpu-defs.h"
#include "softfloat.h"
@@ -828,7 +830,6 @@
#define TARGET_PAGE_BITS 12
-#define CPUState CPUX86State
#define cpu_init cpu_x86_init
#define cpu_exec cpu_x86_exec
#define cpu_gen_code cpu_x86_gen_code
Modified: trunk/target-m68k/cpu.h
===================================================================
--- trunk/target-m68k/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-m68k/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -23,6 +23,8 @@
#define TARGET_LONG_BITS 32
+#define CPUState struct CPUM68KState
+
#include "cpu-defs.h"
#include "softfloat.h"
@@ -207,7 +209,6 @@
#define TARGET_PAGE_BITS 10
#endif
-#define CPUState CPUM68KState
#define cpu_init cpu_m68k_init
#define cpu_exec cpu_m68k_exec
#define cpu_gen_code cpu_m68k_gen_code
Modified: trunk/target-mips/cpu.h
===================================================================
--- trunk/target-mips/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-mips/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -5,6 +5,8 @@
#define ELF_MACHINE EM_MIPS
+#define CPUState struct CPUMIPSState
+
#include "config.h"
#include "mips-defs.h"
#include "cpu-defs.h"
@@ -473,7 +475,6 @@
void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
int unused, int size);
-#define CPUState CPUMIPSState
#define cpu_init cpu_mips_init
#define cpu_exec cpu_mips_exec
#define cpu_gen_code cpu_mips_gen_code
Modified: trunk/target-ppc/cpu.h
===================================================================
--- trunk/target-ppc/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-ppc/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -54,6 +54,8 @@
#endif /* defined (TARGET_PPC64) */
+#define CPUState struct CPUPPCState
+
#include "cpu-defs.h"
#define REGX "%016" PRIx64
@@ -786,7 +788,6 @@
int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, target_ulong *valp);
int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val);
-#define CPUState CPUPPCState
#define cpu_init cpu_ppc_init
#define cpu_exec cpu_ppc_exec
#define cpu_gen_code cpu_ppc_gen_code
Modified: trunk/target-sh4/cpu.h
===================================================================
--- trunk/target-sh4/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-sh4/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -37,6 +37,8 @@
#define SH_CPU_SH7750_ALL (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH7750R)
#define SH_CPU_SH7751_ALL (SH_CPU_SH7751 | SH_CPU_SH7751R)
+#define CPUState struct CPUSH4State
+
#include "cpu-defs.h"
#include "softfloat.h"
@@ -169,7 +171,6 @@
#include "softfloat.h"
-#define CPUState CPUSH4State
#define cpu_init cpu_sh4_init
#define cpu_exec cpu_sh4_exec
#define cpu_gen_code cpu_sh4_gen_code
Modified: trunk/target-sparc/cpu.h
===================================================================
--- trunk/target-sparc/cpu.h 2009-03-07 10:51:36 UTC (rev 6734)
+++ trunk/target-sparc/cpu.h 2009-03-07 15:24:59 UTC (rev 6735)
@@ -15,6 +15,8 @@
#define TARGET_PHYS_ADDR_BITS 64
+#define CPUState struct CPUSPARCState
+
#include "cpu-defs.h"
#include "softfloat.h"
@@ -436,7 +438,6 @@
int is_asi, int size);
int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
-#define CPUState CPUSPARCState
#define cpu_init cpu_sparc_init
#define cpu_exec cpu_sparc_exec
#define cpu_gen_code cpu_sparc_gen_code
^ permalink raw reply
* Re: [PATCH 1/9] omap3isp: Add ISP main driver and register definitions
From: Alexey Klimov @ 2009-03-07 15:25 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, linux-omap, saaguirre, tuukka.o.toivonen,
dongsoo.kim
In-Reply-To: <49AFB8E3.9070909@maxwell.research.nokia.com>
On Thu, 2009-03-05 at 13:34 +0200, Sakari Ailus wrote:
> Thanks for the comments, Alexey!
>
> Alexey Klimov wrote:
> >> +static int isp_probe(struct platform_device *pdev)
> >> +{
> >> + struct isp_device *isp;
> >> + int ret_err = 0;
> >> + int i;
> >> +
> >> + isp = kzalloc(sizeof(*isp), GFP_KERNEL);
> >> + if (!isp) {
> >> + dev_err(&pdev->dev, "could not allocate memory\n");
> >> + return -ENODEV;
> >
> > return -ENOMEM; ?
>
> Done.
>
> >> + }
> >> +
> >> + platform_set_drvdata(pdev, isp);
> >> +
> >> + isp->dev = &pdev->dev;
> >> +
> >> + for (i = 0; i <= OMAP3_ISP_IOMEM_CSI2PHY; i++) {
> >> + struct resource *mem;
> >> + /* request the mem region for the camera registers */
> >> + mem = platform_get_resource(pdev, IORESOURCE_MEM, i);
> >> + if (!mem) {
> >> + dev_err(isp->dev, "no mem resource?\n");
> >> + return -ENODEV;
> >
> > Maybe ENODEV is not apropriate here too..
>
> What else it could be? ENOENT comes to mind but I'm not sure it's
> significantly better.
ENODEV is okay, sorry.
--
Best regards, Klimov Alexey
^ permalink raw reply
* Re: [PATCH, RFC]
From: Eddie Dawydiuk @ 2009-03-07 15:21 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Eddie Dawydiuk
In-Reply-To: <fa686aa40903062141n210f81d7g9f11154f3c78cadc@mail.gmail.com>
Hello,
> On a more general note; this patch also diverges from the original
> model for simple image. The idea behind simpleimage was that it would
> contain a fully formed device tree, with no fixups necessary. I want
> to think carefully before diverging from that.
I wasn't aware of these design goals... I believe one can also modify the
default dts file such that the RAM size is not dynamically detected so the
fixups aren't required(although keep in mind I haven't tested this).
Although it is quite convenient to add the fixed-head.o so one can jump
into the simpleImage at offset 0 rather than having to check what the
offset should be each time a change is made.
//Eddie
^ permalink raw reply
* Re: [TIP][RFC 2/7] futex: futex_top_waiter()
From: Thomas Gleixner @ 2009-03-07 15:16 UTC (permalink / raw)
To: Darren Hart; +Cc: lkml, , Steven Rostedt, Sripathi Kodi, John Stultz
In-Reply-To: <49AC75BA.3030006@us.ibm.com>
On Mon, 2 Mar 2009, Darren Hart wrote:
> From: Darren Hart <dvhltc@us.ibm.com>
>
> Improve legibility by wrapping finding the top waiter in a function. This
> will be used by the follow-on patches for enabling requeue pi.
> +static struct futex_q *futex_top_waiter(struct futex_hash_bucket *hb,
> + union futex_key *key)
Can we just have *head as argument instead of *hb ?
> +{
> + struct plist_head *head;
> + struct futex_q *this;
> + struct futex_q *top_waiter = NULL;
struct futex_q *this;
> + head = &hb->chain;
> + plist_for_each_entry(this, head, list) {
> + if (match_futex(&this->key, key)) {
return this;
> + top_waiter = this;
> + break;
> + }
> + }
> + return top_waiter;
return NULL;
Makes the function half the size.
Thanks,
tglx
^ permalink raw reply
* Re: [PATCH, RFC]
From: Eddie Dawydiuk @ 2009-03-07 15:14 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40903062022i2211ccdfu1bffab54749615d8@mail.gmail.com>
Hello,
> But the question remains: Why do you need simpleboot support for
> Yosemite when you can use a uImage or cuImage with u-boot?
We are developing a new board based upon the Yosemite board. Seeing as
though the Yosemite board was supported in the mainline kernel I decided
to start with that code base. After looking at what different
options/images were available for device trees vs open firmware I decided
the simpleImage would be the ideal format for our new board. I then read
how to build a simpleImage for the Yosemite board, which build without any
compiler errors. Although I found the image didn't work, so I figured it
might be helpful for others if the image just worked without
modifications. Although shortly I will be submitting support for our
custom board using this same approach. So if you have any suggestions on
this approach using the simpleImage please let me know.
On another note, can you tell me/point me to some documentation on how to
get a unique machine ID for a new board?
--
Best Regards,
________________________________________________________________
Eddie Dawydiuk, Technologic Systems | voice: (480) 837-5200
16525 East Laser Drive | fax: (480) 837-5300
Fountain Hills, AZ 85268 | web: www.embeddedARM.com
^ permalink raw reply
* [PATCH, acked] git-p4: remove tabs from usermap file
From: Pete Wyckoff @ 2009-03-07 15:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Simon Hausmann, git
Some users have tabs in their names, oddly enough. This
causes problems when loading the usercache from disk,
as split separates the fields on the wrong tabs. When
fast-import's parse_ident() tries to parse the committer
field, it is unhappy about the unbalanced <..> angle brackets.
It is easy enough to convert the tabs to single spaces.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
---
contrib/fast-import/git-p4 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 3832f60..342529d 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1142,7 +1142,7 @@ class P4Sync(Command):
s = ''
for (key, val) in self.users.items():
- s += "%s\t%s\n" % (key, val)
+ s += "%s\t%s\n" % (key.expandtabs(1), val.expandtabs(1))
open(self.getUserCacheFilename(), "wb").write(s)
self.userMapFromPerforceServer = True
--
1.6.0.6
^ permalink raw reply related
* Re: [PATCH] toshiba_acpi: Add full hotkey support
From: Matthew Garrett @ 2009-03-07 15:06 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: linux-acpi, linux-kernel
In-Reply-To: <E1LfqwF-000B1G-00.arvidjaar-mail-ru@mx3.mail.ru>
On Sat, Mar 07, 2009 at 10:27:09AM +0300, Andrey Borzenkov wrote:
> Matthew Garrett wrote:
>
> > + {KE_KEY, 0x13d, KEY_SLEEP},
> > + {KE_KEY, 0x13e, KEY_SUSPEND},
>
> I have two buttons marked with memory and disk pictures. When I press the
> first one HAL emits "sleep" button event, for the the second one HAL emits
> "hibernate" event. I am using KDE4 and neither works :) According to KDE4
> developer, they implement "suspend" button as suspend to RAM. Just trying to
> clarify which key this should be and whether HAL should be fixed. (I opened
> bug report for KDE4)
Yeah, I'm not really a KDE guy, so I'm not sure what's happening there.
> > + {KE_KEY, 0x13f, KEY_SWITCHVIDEOMODE},
>
> I wonder, who is supposed to act upon it? Is there any generic user space
> agent who implements video output switching?
At present I don't believe so, no.
> > + {KE_KEY, 0x140, KEY_BRIGHTNESSDOWN},
> > + {KE_KEY, 0x141, KEY_BRIGHTNESSUP},
> > + {KE_KEY, 0x142, KEY_WLAN},
>
> Ditto. Theoretically Toshiba even supports turning off radio via HCI, but it
> is again not clear who should actually initiate it.
Right. In some of these cases there's nothing that currently handles
them, but userspace should probably get round to it at some point.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* Re: preliminary nv50 wfb patch
From: Maarten Maathuis @ 2009-03-07 15:04 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
In-Reply-To: <6d4bc9fc0903070520q6418197vce462940290e47c5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]
This one has been optimised further, all usage of modulus has been removed.
There are still optimisations to do (like using hostdata transfers for
the first pixmap access), but this is getting closer to usable.
Maarten.
On Sat, Mar 7, 2009 at 2:20 PM, Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> This version is a bit faster by avoiding the need for (SUB)TILE_WIDTH.
>
> On Sat, Mar 7, 2009 at 1:59 PM, Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> This patch will only work with Option "EXAPixmaps" "1", and will
>> prevent classic exa from working.
>>
>> Occasionally a pixmap fails to map, but that's not related to this patch.
>>
>> I haven't done any hardcore optimisations, but suggestions are
>> ofcource appreciated.
>>
>> In my experience some benchmarks suck now (gtkperf for which had it's
>> performance halved), and qt4 is definitely faster than gtk (gtk has
>> some odd rendering scenarios).
>>
>> This is by no means finished, but i wanted to share what i have.
>>
>> Maarten.
>>
>
[-- Attachment #2: wfb_test17.patch --]
[-- Type: application/octet-stream, Size: 9999 bytes --]
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index 93fc3c5..d1e37b0 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -351,17 +351,16 @@ nouveau_exa_modify_pixmap_header(PixmapPtr ppix, int width, int height,
if (!nvpix->bo && nvpix->size) {
uint32_t cpp = ppix->drawable.bitsPerPixel >> 3;
- /* At some point we should just keep 1bpp pixmaps in sysram */
uint32_t flags = NOUVEAU_BO_VRAM;
int ret;
if (pNv->Architecture >= NV_ARCH_50 && cpp) {
- uint32_t aw = (width + 7) & ~7;
- uint32_t ah = (height + 7) & ~7;
+ uint32_t ah = (height + 3) & ~3;
flags |= NOUVEAU_BO_TILED;
- devkind = ((aw * cpp) + 63) & ~63;
+ /* This alligment is very important. */
+ devkind = (width * cpp + 63) & ~63;
nvpix->size = devkind * ah;
}
@@ -390,8 +389,11 @@ nouveau_exa_pixmap_is_tiled(PixmapPtr ppix)
NVPtr pNv = NVPTR(pScrn);
if (pNv->exa_driver_pixmaps) {
- if (!nouveau_pixmap_bo(ppix)->tiled)
+ if (!nouveau_pixmap_bo(ppix))
return false;
+ if (nouveau_pixmap_bo(ppix)->tiled == 0)
+ return false;
+ return true;
} else
if (pNv->Architecture < NV_ARCH_50 ||
exaGetPixmapOffset(ppix) < pNv->EXADriverPtr->offScreenBase)
@@ -406,7 +408,7 @@ nouveau_exa_pixmap_map(PixmapPtr ppix)
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
unsigned delta = nouveau_pixmap_offset(ppix);
- if (bo->tiled) {
+ if (0 && bo->tiled) {
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
nvpix->linear = xcalloc(1, ppix->devKind * ppix->drawable.height);
@@ -428,7 +430,7 @@ nouveau_exa_pixmap_unmap(PixmapPtr ppix)
{
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
- if (bo->tiled) {
+ if (0 && bo->tiled) {
struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
NVAccelUploadM2MF(ppix, 0, 0, ppix->drawable.width,
@@ -674,3 +676,197 @@ nouveau_exa_init(ScreenPtr pScreen)
pNv->EXADriverPtr = exa;
return TRUE;
}
+
+/* WFB functions. */
+
+static FbBits
+nouveau_exa_wfb_read_memory_linear(const void *src, int size)
+{
+ FbBits bits = 0;
+
+ memcpy(&bits, src, size);
+
+ return bits;
+}
+
+static void
+nouveau_exa_wfb_write_memory_linear(void *dst, FbBits value, int size)
+{
+ memcpy(dst, &value, size);
+}
+
+#define TILE_PITCH 32
+#define TILE_HEIGHT 4
+#define SUBTILE_PITCH 8
+#define SUBTILE_HEIGHT 2
+
+#define LINEAR_PITCH (pPixmap->devKind)
+#define NUM_TILES_WIDTH (LINEAR_PITCH/TILE_PITCH)
+
+static NVPtr last_wfb_pNv = NULL;
+
+/* Note, we can only expose one read and write function, the linear versions are for internal consumption. */
+static FbBits
+nouveau_exa_wfb_read_memory(const void *src, int size)
+{
+ int i, line_x, line_y, tile_x, tile_y, subtile_x, subtile_y;
+ unsigned long offset = (unsigned long) src, subpixel_offset;
+ PixmapPtr pPixmap = NULL;
+ FbBits bits = 0;
+ void *new_src;
+
+ if (!last_wfb_pNv)
+ return nouveau_exa_wfb_read_memory_linear(src, size);
+
+ /* Find the right pixmap. */
+ for (i = 0; i < 6; i++)
+ if (offset >= last_wfb_pNv->wfb_pixmaps[i].start && offset < last_wfb_pNv->wfb_pixmaps[i].end) {
+ pPixmap = last_wfb_pNv->wfb_pixmaps[i].ppix;
+ break;
+ }
+
+ if (!pPixmap || !last_wfb_pNv->wfb_pixmaps[i].tiled)
+ return nouveau_exa_wfb_read_memory_linear(src, size);
+
+ /* Now comes the decoding. */
+ offset -= (unsigned long) pPixmap->devPrivate.ptr;
+ /* Assuming dword alligned offsets. */
+ subpixel_offset = offset & ((pPixmap->drawable.bitsPerPixel >> 3) - 1);
+ offset -= subpixel_offset;
+
+ /* Determine the coordinate first. */
+ line_y = offset/LINEAR_PITCH;
+ line_x = offset - line_y * LINEAR_PITCH;
+ tile_x = line_x/TILE_PITCH;
+ tile_y = line_y/TILE_HEIGHT;
+ subtile_x = (line_x - tile_x * TILE_PITCH)/SUBTILE_PITCH;
+ subtile_y = (line_y - tile_y * TILE_HEIGHT)/SUBTILE_HEIGHT;
+
+ new_src = pPixmap->devPrivate.ptr +
+ (((tile_y * NUM_TILES_WIDTH) + tile_x) * (TILE_HEIGHT * TILE_PITCH)) +
+ (((subtile_y * (TILE_PITCH/SUBTILE_PITCH)) + subtile_x) * (SUBTILE_HEIGHT * SUBTILE_PITCH)) +
+ ((line_y - tile_y * TILE_HEIGHT - subtile_y * SUBTILE_HEIGHT) * SUBTILE_PITCH) +
+ (line_x - tile_x * TILE_PITCH - subtile_x * SUBTILE_PITCH) +
+ subpixel_offset;
+
+ memcpy(&bits, new_src, size);
+
+ return bits;
+}
+
+static void
+nouveau_exa_wfb_write_memory(void *dst, FbBits value, int size)
+{
+ int i, line_x, line_y, tile_x, tile_y, subtile_x, subtile_y;
+ unsigned long offset = (unsigned long) dst, subpixel_offset;
+ PixmapPtr pPixmap = NULL;
+ void *new_dst;
+
+ if (!last_wfb_pNv) {
+ nouveau_exa_wfb_write_memory_linear(dst, value, size);
+ return;
+ }
+
+ /* Find the right pixmap. */
+ for (i = 0; i < 6; i++)
+ if (offset >= last_wfb_pNv->wfb_pixmaps[i].start && offset < last_wfb_pNv->wfb_pixmaps[i].end) {
+ pPixmap = last_wfb_pNv->wfb_pixmaps[i].ppix;
+ break;
+ }
+
+ if (!pPixmap || !last_wfb_pNv->wfb_pixmaps[i].tiled) {
+ nouveau_exa_wfb_write_memory_linear(dst, value, size);
+ return;
+ }
+
+ /* Now comes the decoding. */
+ offset -= (unsigned long) pPixmap->devPrivate.ptr;
+ /* Assuming dword alligned offsets. */
+ subpixel_offset = offset & ((pPixmap->drawable.bitsPerPixel >> 3) - 1);
+ offset -= subpixel_offset;
+
+ /* Determine the coordinate first. */
+ line_y = offset/LINEAR_PITCH;
+ line_x = offset - line_y * LINEAR_PITCH;
+ tile_x = line_x/TILE_PITCH;
+ tile_y = line_y/TILE_HEIGHT;
+ subtile_x = (line_x - tile_x * TILE_PITCH)/SUBTILE_PITCH;
+ subtile_y = (line_y - tile_y * TILE_HEIGHT)/SUBTILE_HEIGHT;
+
+ new_dst = pPixmap->devPrivate.ptr +
+ (((tile_y * NUM_TILES_WIDTH) + tile_x) * (TILE_HEIGHT * TILE_PITCH)) +
+ (((subtile_y * (TILE_PITCH/SUBTILE_PITCH)) + subtile_x) * (SUBTILE_HEIGHT * SUBTILE_PITCH)) +
+ ((line_y - tile_y * TILE_HEIGHT - subtile_y * SUBTILE_HEIGHT) * SUBTILE_PITCH) +
+ (line_x - tile_x * TILE_PITCH - subtile_x * SUBTILE_PITCH) +
+ subpixel_offset;
+
+ memcpy(new_dst, &value, size);
+}
+
+void
+nouveau_exa_wfb_setup_wrap(ReadMemoryProcPtr *pRead,
+ WriteMemoryProcPtr *pWrite,
+ DrawablePtr pDraw)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pDraw->pScreen->myNum];
+ NVPtr pNv = NVPTR(pScrn);
+ PixmapPtr pPixmap;
+
+ if (!pRead || !pWrite)
+ return;
+
+ pPixmap = NVGetDrawablePixmap(pDraw);
+ if (!pPixmap)
+ return;
+
+ int i;
+ for (i = 0; i < 6; i++)
+ if (!pNv->wfb_pixmaps[i].used)
+ break;
+
+ if (i == 6) {
+ ErrorF("More than 10 wraps are setup, what the hell is going on?\n");
+ *pRead = NULL;
+ *pWrite = NULL;
+ return;
+ }
+
+ /* We will get a pointer, somewhere in the range of this pixmap. */
+ /* Based on linear representation ofcource. */
+ pNv->wfb_pixmaps[i].ppix = pPixmap;
+ pNv->wfb_pixmaps[i].start = (unsigned long) pPixmap->devPrivate.ptr;
+ pNv->wfb_pixmaps[i].end = pNv->wfb_pixmaps[i].start + exaGetPixmapPitch(pPixmap) * ((pPixmap->drawable.height + 3) & ~3);
+ pNv->wfb_pixmaps[i].used = true;
+ if (nouveau_exa_pixmap_is_tiled(pPixmap))
+ pNv->wfb_pixmaps[i].tiled = true;
+ else
+ pNv->wfb_pixmaps[i].tiled = false;
+
+ *pRead = nouveau_exa_wfb_read_memory;
+ *pWrite = nouveau_exa_wfb_write_memory;
+
+ last_wfb_pNv = pNv;
+}
+
+void
+nouveau_exa_wfb_finish_wrap(DrawablePtr pDraw)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pDraw->pScreen->myNum];
+ NVPtr pNv = NVPTR(pScrn);
+ PixmapPtr pPixmap;
+ int i;
+
+ pPixmap = NVGetDrawablePixmap(pDraw);
+ if (!pPixmap)
+ return;
+
+ for (i = 0; i < 10; i++)
+ if (pNv->wfb_pixmaps[i].ppix == pPixmap) {
+ pNv->wfb_pixmaps[i].ppix = NULL;
+ pNv->wfb_pixmaps[i].start = 0;
+ pNv->wfb_pixmaps[i].end = 0;
+ pNv->wfb_pixmaps[i].used = false;
+ pNv->wfb_pixmaps[i].tiled = false;
+ break;
+ }
+}
diff --git a/src/nv_driver.c b/src/nv_driver.c
index d7e8025..bdea2b6 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1510,7 +1510,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
* section.
*/
- if (xf86LoadSubModule(pScrn, "fb") == NULL)
+ if (xf86LoadSubModule(pScrn, "wfb") == NULL)
NVPreInitFail("\n");
xf86LoaderReqSymLists(fbSymbols, NULL);
@@ -2154,9 +2154,10 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
switch (pScrn->bitsPerPixel) {
case 16:
case 32:
- ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX, pScrn->virtualY,
+ ret = wfbScreenInit(pScreen, FBStart, pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
- displayWidth, pScrn->bitsPerPixel);
+ displayWidth, pScrn->bitsPerPixel,
+ nouveau_exa_wfb_setup_wrap, nouveau_exa_wfb_finish_wrap);
break;
default:
xf86DrvMsg(scrnIndex, X_ERROR,
@@ -2181,7 +2182,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
- fbPictureInit (pScreen, 0, 0);
+ wfbPictureInit (pScreen, 0, 0);
xf86SetBlackWhitePixels(pScreen);
diff --git a/src/nv_include.h b/src/nv_include.h
index be004ef..f78cda0 100644
--- a/src/nv_include.h
+++ b/src/nv_include.h
@@ -47,6 +47,7 @@
#include "dixstruct.h"
#include "scrnintstr.h"
+#define FB_ACCESS_WRAPPER 1
#include "fb.h"
#include "xf86cmap.h"
diff --git a/src/nv_proto.h b/src/nv_proto.h
index 28605a8..5933ddd 100644
--- a/src/nv_proto.h
+++ b/src/nv_proto.h
@@ -65,6 +65,10 @@ void NVTakedownDma(ScrnInfoPtr pScrn);
Bool nouveau_exa_init(ScreenPtr pScreen);
Bool nouveau_exa_pixmap_is_onscreen(PixmapPtr pPixmap);
bool nouveau_exa_pixmap_is_tiled(PixmapPtr ppix);
+void nouveau_exa_wfb_setup_wrap(ReadMemoryProcPtr *pRead,
+ WriteMemoryProcPtr *pWrite,
+ DrawablePtr pDraw);
+void nouveau_exa_wfb_finish_wrap(DrawablePtr pDraw);
/* in nv_hw.c */
void NVCalcStateExt(ScrnInfoPtr,struct _riva_hw_state *,int,int,int,int,int,int);
diff --git a/src/nv_type.h b/src/nv_type.h
index 78a7802..24b628f 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -404,6 +404,15 @@ typedef struct _NVRec {
unsigned point_x, point_y;
unsigned width_in, width_out;
unsigned height_in, height_out;
+
+ /* Wfb related data. */
+ struct {
+ PixmapPtr ppix;
+ bool used;
+ bool tiled;
+ unsigned long start;
+ unsigned long end;
+ } wfb_pixmaps[6];
} NVRec;
#define NVPTR(p) ((NVPtr)((p)->driverPrivate))
[-- Attachment #3: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related
* [Q] bulk parameter settings
From: Guennadi Liakhovetski @ 2009-03-07 15:04 UTC (permalink / raw)
To: Linux Media Mailing List; +Cc: morimoto.kuninori
Hi,
In a patch by Morimoto-san [1] he proposed a method to allow platforms to
specify register address-value pairs to be directly flushed in by the
driver into the sensor.
While I am not very fond of this approach, I cannot think of a proper way
to do this. We used to have S_REGISTER ioctl()s, which even back then
depended on advanced debugging, and are now even more discouraged.
Besides, in his example he had 85 (!) register values, calling S_REGISTER
85 times wouldn't be very efficient either, even if we accept it as a
mainstream method.
Creating real new controls for all those registers (ok, maybe most of them
already exist, or can be derived from others, which would probably leave
us with 20-40 new controls) seems an overkill too.
Loading the settings as an array from user-space using the firmware-loader
procedure, doesn't seem to fit very well - this is not firmware, this is
not code that will run, these are just configuration values.
I can think of a couple more possibilities, but none of them makes me
really happy. What do other drivers do or what is the best solution to
this problem? I understand, in "closed" devices, where all components are
fixed, and there are only a finate number of hardware configurations (PCI
/ USB), this problem doesn't really exist, but with "gadgets" (as we from
now on shall call all soc-camera users) hardware designers have a freedom
to select single components to fit their specific needs.
Any thoughts?
Of all the above I would probably prefer to abuse the firmware loading
procedure, or are there better options?
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.spinics.net/lists/linux-media/msg02347.html
^ permalink raw reply
* Re: Houston, we have May 15, 1953 (says guest when host uses cpufreq, and dies)
From: Tomasz Chmielewski @ 2009-03-07 14:59 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm
In-Reply-To: <20090218185734.GA26408@amt.cnet>
Marcelo Tosatti schrieb:
>> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
>> bogomips : 3993.20
>> TLB size : 1024 4K pages
>> clflush size : 64
>> cache_alignment : 64
>> address sizes : 40 bits physical, 48 bits virtual
>> power management: ts fid vid ttp tm stc
>
> kvm-84 as mentioned. Sorry.
>
It is not stable for me (although I did go through exactly the same routine with kvm-83) - I got an oops.
I'm not sure if the problem is kvm or cpufreq.
This is what I did:
- stopped all kvm-83 guests, removed all kvm-83 modules
- inserted kvm-83 modules, started 9 guests with kvm-84 binary
- inserted cpufreq modules and set the governor to ondemand
- cat /proc/cpuinfo revealed that CPUs are still running at full speed, so I did:
cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
but it didn't return and cat was in "D" state.
- I stopped all guests, removed kvm-84 modules, and got this oops:
Unable to handle kernel paging request at ffffffff88429721 RIP:
[<ffffffff88429721>]
PGD 203067 PUD 207063 PMD 1184dc067 PTE 0
Oops: 0010 [1] PREEMPT SMP
CPU: 0
Modules linked in: loop cpufreq_ondemand powernow_k8 freq_table crc32c libcrc32c vzethdev vznetdev simfs vzrst vzcpt tun vzdquota vzmon ipv6 vzdev xt_tcpudp xt_length ipt_ttl xt_tcpmss xt_TCPMSS iptable_mangle iptable_filter xt_multiport xt_limit ipt_tos ipt_REJECT ip_tables x_tables ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi scsi_transport_iscsi bridge 8021q bonding dm_snapshot dm_mirror dm_multipath dm_mod joydev usbhid hid sata_svw pata_serverworks psmouse ehci_hcd ohci_hcd evdev thermal button ata_generic pata_acpi serio_raw i2c_piix4 tg3 container pcspkr libata usbcore processor i2c_core ssb shpchp pci_hotplug k8temp romfs isofs sd_mod sg mptsas mptscsih mptbase scsi_transport_sas scsi_mod raid1 md_mod
Pid: 20389, comm: kondemand/0 Not tainted 2.6.24-2-pve #1 ovz005
RIP: 0010:[<ffffffff88429721>] [<ffffffff88429721>]
RSP: 0018:ffff810039d09d20 EFLAGS: 00010202
RAX: 0000000000000001 RBX: 00000000ef41d1f5 RCX: ffffffff806cf690
RDX: 0000000000000000 RSI: ffff810080959000 RDI: ffffffff88450e80
RBP: 0000000000000000 R08: 00000000001e8480 R09: 0000000000000000
R10: ffff810001027ee0 R11: 0000000000000001 R12: ffffffff88450e90
R13: ffff810039d09df0 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f93a7d736d0(0000) GS:ffffffff8060b000(0000) knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: ffffffff88429721 CR3: 0000000000201000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kondemand/0 (pid: 20389, veid=0, threadinfo ffff810039d08000, task ffff810039d06000)
Stack: 00000000ef41d1f5 0000000000000000 ffffffff88451950 ffff810039d09df0
0000000000000001 ffffffff804aa671 ffffffff8077b1f0 ffff810039d09df0
0000000000000000 00000000ffffffff ffffffff8077b1c0 ffffffff8025ca0a
Call Trace:
[<ffffffff804aa671>] notifier_call_chain+0x51/0x70
[<ffffffff8025ca0a>] __srcu_notifier_call_chain+0x5a/0x90
[<ffffffff8040897d>] cpufreq_notify_transition+0x7d/0xb0
[<ffffffff8846f9ef>] :powernow_k8:powernowk8_target+0x2bf/0x690
[<ffffffff8847671a>] :cpufreq_ondemand:do_dbs_timer+0x26a/0x300
[<ffffffff884764b0>] :cpufreq_ondemand:do_dbs_timer+0x0/0x300
[<ffffffff80252a38>] run_workqueue+0x88/0x120
[<ffffffff80253610>] worker_thread+0x0/0x130
[<ffffffff802536d5>] worker_thread+0xc5/0x130
[<ffffffff80257f70>] autoremove_wake_function+0x0/0x30
[<ffffffff80253610>] worker_thread+0x0/0x130
[<ffffffff80253610>] worker_thread+0x0/0x130
[<ffffffff80257b9b>] kthread+0x4b/0x80
[<ffffffff8020d338>] child_rip+0xa/0x12
[<ffffffff80257b50>] kthread+0x0/0x80
[<ffffffff8020d32e>] child_rip+0x0/0x12
Code: Bad RIP value.
RIP [<ffffffff88429721>]
RSP <ffff810039d09d20>
CR2: ffffffff88429721
---[ end trace e6b0e16fe814aeb1 ]---
note: kondemand/0[20389] exited with preempt_count 1
--
Tomasz Chmielewski
http://wpkg.org
^ permalink raw reply
* [Design] nested partitions: Unify grub_partition and grub_disk
From: phcoder @ 2009-03-07 14:58 UTC (permalink / raw)
To: The development of GRUB 2
Hello. I was looking into nested partitions issue and propose to unify
grub_partition and grub_disk. In this case when a code calls
grub_disk_read with a grub_disk_t which represents a partition it will
correct the offset and call grub_disk_read with underlying partition or
disk. In this way not only nested partitions become natural but also
conceptually similar fields of total_sectors and len become unified. As
it's an important design change I send this e-mail before coding it
--
Regards
Vladimir 'phcoder' Serbinenko
^ permalink raw reply
* [PATCH] ftrace: fix documentaion typo s/trace_max_latency/tracing_max_latency/
From: KOSAKI Motohiro @ 2009-03-07 14:55 UTC (permalink / raw)
To: Ingo Molnar, Steven Rostedt, LKML; +Cc: kosaki.motohiro
In-Reply-To: <20090307235209.5A84.A69D9226@jp.fujitsu.com>
There isn't trace_max_latency. there is tracing_max_latency.
fixing here.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
Documentation/ftrace.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index d124e6a..aad5809 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -93,7 +93,7 @@ of ftrace. Here is a list of some of the key files:
that is displayed in one of the above output
files.
- trace_max_latency:
+ tracing_max_latency:
Some of the tracers record the max latency.
For example, the time interrupts are disabled.
--
1.6.0.6
^ permalink raw reply related
* Re: [Patch 11/11] ftrace plugin for kernel symbol tracing using HW Breakpoint interfaces - v2
From: KOSAKI Motohiro @ 2009-03-07 14:53 UTC (permalink / raw)
To: prasad
Cc: kosaki.motohiro, mingo, Andrew Morton, Linux Kernel Mailing List,
Alan Stern, Roland McGrath
In-Reply-To: <20090307050747.GL23959@in.ibm.com>
Hi
> This patch adds an ftrace plugin to detect and profile memory access over
> kernel variables. It uses HW Breakpoint interfaces to 'watch memory
> addresses.
>
> Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
> ---
> kernel/trace/Kconfig | 6
> kernel/trace/Makefile | 1
> kernel/trace/trace.h | 16 +
> kernel/trace/trace_ksym.c | 448 ++++++++++++++++++++++++++++++++++++++++++
> kernel/trace/trace_selftest.c | 36 +++
> 5 files changed, 507 insertions(+)
Could you please update Documentation/ftrace.txt?
I guess many user interesting this patch. :)
^ permalink raw reply
* [PATCH for tip] ftrace: remove latency_trace document
From: KOSAKI Motohiro @ 2009-03-07 14:53 UTC (permalink / raw)
To: Ingo Molnar, Steven Rostedt, LKML; +Cc: kosaki.motohiro
Subject: [PATCH] remove latency_trace document
Currently, there aren't "Latency tracer" and latency_trace file.
Then, its documentation is removed too.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
Documentation/ftrace.txt | 550 +--------------------------------------------
1 files changed, 13 insertions(+), 537 deletions(-)
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index 22614be..d124e6a 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -29,7 +29,7 @@ means that the list of tracers can always grow).
The File System
---------------
-
+1
Ftrace uses the debugfs file system to hold the control files as
well as the files to display output.
@@ -73,26 +73,19 @@ of ftrace. Here is a list of some of the key files:
This file holds the output of the trace in a human
readable format (described below).
- latency_trace:
-
- This file shows the same trace but the information
- is organized more to display possible latencies
- in the system (described below).
-
trace_pipe:
The output is the same as the "trace" file but this
file is meant to be streamed with live tracing.
Reads from this file will block until new data
- is retrieved. Unlike the "trace" and "latency_trace"
- files, this file is a consumer. This means reading
- from this file causes sequential reads to display
- more current data. Once data is read from this
- file, it is consumed, and will not be read
- again with a sequential read. The "trace" and
- "latency_trace" files are static, and if the
- tracer is not adding more data, they will display
- the same information every time they are read.
+ is retrieved. Unlike the "trace" file, this file
+ is a consumer. This means reading from this file
+ causes sequential reads to display more current data.
+ Once data is read from this file, it is consumed,
+ and will not be read again with a sequential read.
+ The "trace" files is static, and if the tracer is not
+ adding more data, they will display the same information
+ every time they are read.
trace_options:
@@ -105,10 +98,10 @@ of ftrace. Here is a list of some of the key files:
Some of the tracers record the max latency.
For example, the time interrupts are disabled.
This time is saved in this file. The max trace
- will also be stored, and displayed by either
- "trace" or "latency_trace". A new max trace will
- only be recorded if the latency is greater than
- the value in this file. (in microseconds)
+ will also be stored, and displayed by "trace".
+ A new max trace will only be recorded if the
+ latency is greater than the value in this file.
+ (in microseconds)
buffer_size_kb:
@@ -192,25 +185,6 @@ Here is the list of current tracers that may be configured.
Traces the context switches and wakeups between tasks.
- "irqsoff"
-
- Traces the areas that disable interrupts and saves
- the trace with the longest max latency.
- See tracing_max_latency. When a new max is recorded,
- it replaces the old trace. It is best to view this
- trace via the latency_trace file.
-
- "preemptoff"
-
- Similar to irqsoff but traces and records the amount of
- time for which preemption is disabled.
-
- "preemptirqsoff"
-
- Similar to irqsoff and preemptoff, but traces and
- records the largest time for which irqs and/or preemption
- is disabled.
-
"wakeup"
Traces and records the max latency that it takes for
@@ -292,97 +266,6 @@ nice 19. The prio "140" is reserved for the idle task which is
the lowest priority thread (pid 0).
-Latency trace format
---------------------
-
-For traces that display latency times, the latency_trace file
-gives somewhat more information to see why a latency happened.
-Here is a typical trace.
-
-# tracer: irqsoff
-#
-irqsoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 97 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: swapper-0 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: apic_timer_interrupt
- => ended at: do_softirq
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- <idle>-0 0d..1 0us+: trace_hardirqs_off_thunk (apic_timer_interrupt)
- <idle>-0 0d.s. 97us : __do_softirq (do_softirq)
- <idle>-0 0d.s1 98us : trace_hardirqs_on (do_softirq)
-
-
-This shows that the current tracer is "irqsoff" tracing the time
-for which interrupts were disabled. It gives the trace version
-and the version of the kernel upon which this was executed on
-(2.6.26-rc8). Then it displays the max latency in microsecs (97
-us). The number of trace entries displayed and the total number
-recorded (both are three: #3/3). The type of preemption that was
-used (PREEMPT). VP, KP, SP, and HP are always zero and are
-reserved for later use. #P is the number of online CPUS (#P:2).
-
-The task is the process that was running when the latency
-occurred. (swapper pid: 0).
-
-The start and stop (the functions in which the interrupts were
-disabled and enabled respectively) that caused the latencies:
-
- apic_timer_interrupt is where the interrupts were disabled.
- do_softirq is where they were enabled again.
-
-The next lines after the header are the trace itself. The header
-explains which is which.
-
- cmd: The name of the process in the trace.
-
- pid: The PID of that process.
-
- CPU#: The CPU which the process was running on.
-
- irqs-off: 'd' interrupts are disabled. '.' otherwise.
- Note: If the architecture does not support a way to
- read the irq flags variable, an 'X' will always
- be printed here.
-
- need-resched: 'N' task need_resched is set, '.' otherwise.
-
- hardirq/softirq:
- 'H' - hard irq occurred inside a softirq.
- 'h' - hard irq is running
- 's' - soft irq is running
- '.' - normal context.
-
- preempt-depth: The level of preempt_disabled
-
-The above is mostly meaningful for kernel developers.
-
- time: This differs from the trace file output. The trace file output
- includes an absolute timestamp. The timestamp used by the
- latency_trace file is relative to the start of the trace.
-
- delay: This is just to help catch your eye a bit better. And
- needs to be fixed to be only relative to the same CPU.
- The marks are determined by the difference between this
- current trace and the next trace.
- '!' - greater than preempt_mark_thresh (default 100)
- '+' - greater than 1 microsecond
- ' ' - less than or equal to 1 microsecond.
-
- The rest is the same as the 'trace' file.
-
-
trace_options
-------------
@@ -556,413 +439,6 @@ functions that are within the trace. The descriptions of the
tracers will also show an example with ftrace enabled.
-irqsoff
--------
-
-When interrupts are disabled, the CPU can not react to any other
-external event (besides NMIs and SMIs). This prevents the timer
-interrupt from triggering or the mouse interrupt from letting
-the kernel know of a new mouse event. The result is a latency
-with the reaction time.
-
-The irqsoff tracer tracks the time for which interrupts are
-disabled. When a new maximum latency is hit, the tracer saves
-the trace leading up to that latency point so that every time a
-new maximum is reached, the old saved trace is discarded and the
-new trace is saved.
-
-To reset the maximum, echo 0 into tracing_max_latency. Here is
-an example:
-
- # echo irqsoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
- # ls -ltr
- [...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
-# tracer: irqsoff
-#
-irqsoff latency trace v1.1.5 on 2.6.26
---------------------------------------------------------------------
- latency: 12 us, #3/3, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: bash-3730 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: sys_setpgid
- => ended at: sys_setpgid
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- bash-3730 1d... 0us : _write_lock_irq (sys_setpgid)
- bash-3730 1d..1 1us+: _write_unlock_irq (sys_setpgid)
- bash-3730 1d..2 14us : trace_hardirqs_on (sys_setpgid)
-
-
-Here we see that that we had a latency of 12 microsecs (which is
-very good). The _write_lock_irq in sys_setpgid disabled
-interrupts. The difference between the 12 and the displayed
-timestamp 14us occurred because the clock was incremented
-between the time of recording the max latency and the time of
-recording the function that had that latency.
-
-Note the above example had ftrace_enabled not set. If we set the
-ftrace_enabled, we get a much larger output:
-
-# tracer: irqsoff
-#
-irqsoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 50 us, #101/101, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: ls-4339 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: __alloc_pages_internal
- => ended at: __alloc_pages_internal
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- ls-4339 0...1 0us+: get_page_from_freelist (__alloc_pages_internal)
- ls-4339 0d..1 3us : rmqueue_bulk (get_page_from_freelist)
- ls-4339 0d..1 3us : _spin_lock (rmqueue_bulk)
- ls-4339 0d..1 4us : add_preempt_count (_spin_lock)
- ls-4339 0d..2 4us : __rmqueue (rmqueue_bulk)
- ls-4339 0d..2 5us : __rmqueue_smallest (__rmqueue)
- ls-4339 0d..2 5us : __mod_zone_page_state (__rmqueue_smallest)
- ls-4339 0d..2 6us : __rmqueue (rmqueue_bulk)
- ls-4339 0d..2 6us : __rmqueue_smallest (__rmqueue)
- ls-4339 0d..2 7us : __mod_zone_page_state (__rmqueue_smallest)
- ls-4339 0d..2 7us : __rmqueue (rmqueue_bulk)
- ls-4339 0d..2 8us : __rmqueue_smallest (__rmqueue)
-[...]
- ls-4339 0d..2 46us : __rmqueue_smallest (__rmqueue)
- ls-4339 0d..2 47us : __mod_zone_page_state (__rmqueue_smallest)
- ls-4339 0d..2 47us : __rmqueue (rmqueue_bulk)
- ls-4339 0d..2 48us : __rmqueue_smallest (__rmqueue)
- ls-4339 0d..2 48us : __mod_zone_page_state (__rmqueue_smallest)
- ls-4339 0d..2 49us : _spin_unlock (rmqueue_bulk)
- ls-4339 0d..2 49us : sub_preempt_count (_spin_unlock)
- ls-4339 0d..1 50us : get_page_from_freelist (__alloc_pages_internal)
- ls-4339 0d..2 51us : trace_hardirqs_on (__alloc_pages_internal)
-
-
-
-Here we traced a 50 microsecond latency. But we also see all the
-functions that were called during that time. Note that by
-enabling function tracing, we incur an added overhead. This
-overhead may extend the latency times. But nevertheless, this
-trace has provided some very helpful debugging information.
-
-
-preemptoff
-----------
-
-When preemption is disabled, we may be able to receive
-interrupts but the task cannot be preempted and a higher
-priority task must wait for preemption to be enabled again
-before it can preempt a lower priority task.
-
-The preemptoff tracer traces the places that disable preemption.
-Like the irqsoff tracer, it records the maximum latency for
-which preemption was disabled. The control of preemptoff tracer
-is much like the irqsoff tracer.
-
- # echo preemptoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
- # ls -ltr
- [...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
-# tracer: preemptoff
-#
-preemptoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 29 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: do_IRQ
- => ended at: __do_softirq
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- sshd-4261 0d.h. 0us+: irq_enter (do_IRQ)
- sshd-4261 0d.s. 29us : _local_bh_enable (__do_softirq)
- sshd-4261 0d.s1 30us : trace_preempt_on (__do_softirq)
-
-
-This has some more changes. Preemption was disabled when an
-interrupt came in (notice the 'h'), and was enabled while doing
-a softirq. (notice the 's'). But we also see that interrupts
-have been disabled when entering the preempt off section and
-leaving it (the 'd'). We do not know if interrupts were enabled
-in the mean time.
-
-# tracer: preemptoff
-#
-preemptoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 63 us, #87/87, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: remove_wait_queue
- => ended at: __do_softirq
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- sshd-4261 0d..1 0us : _spin_lock_irqsave (remove_wait_queue)
- sshd-4261 0d..1 1us : _spin_unlock_irqrestore (remove_wait_queue)
- sshd-4261 0d..1 2us : do_IRQ (common_interrupt)
- sshd-4261 0d..1 2us : irq_enter (do_IRQ)
- sshd-4261 0d..1 2us : idle_cpu (irq_enter)
- sshd-4261 0d..1 3us : add_preempt_count (irq_enter)
- sshd-4261 0d.h1 3us : idle_cpu (irq_enter)
- sshd-4261 0d.h. 4us : handle_fasteoi_irq (do_IRQ)
-[...]
- sshd-4261 0d.h. 12us : add_preempt_count (_spin_lock)
- sshd-4261 0d.h1 12us : ack_ioapic_quirk_irq (handle_fasteoi_irq)
- sshd-4261 0d.h1 13us : move_native_irq (ack_ioapic_quirk_irq)
- sshd-4261 0d.h1 13us : _spin_unlock (handle_fasteoi_irq)
- sshd-4261 0d.h1 14us : sub_preempt_count (_spin_unlock)
- sshd-4261 0d.h1 14us : irq_exit (do_IRQ)
- sshd-4261 0d.h1 15us : sub_preempt_count (irq_exit)
- sshd-4261 0d..2 15us : do_softirq (irq_exit)
- sshd-4261 0d... 15us : __do_softirq (do_softirq)
- sshd-4261 0d... 16us : __local_bh_disable (__do_softirq)
- sshd-4261 0d... 16us+: add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s4 20us : add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s4 21us : sub_preempt_count (local_bh_enable)
- sshd-4261 0d.s5 21us : sub_preempt_count (local_bh_enable)
-[...]
- sshd-4261 0d.s6 41us : add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s6 42us : sub_preempt_count (local_bh_enable)
- sshd-4261 0d.s7 42us : sub_preempt_count (local_bh_enable)
- sshd-4261 0d.s5 43us : add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s5 43us : sub_preempt_count (local_bh_enable_ip)
- sshd-4261 0d.s6 44us : sub_preempt_count (local_bh_enable_ip)
- sshd-4261 0d.s5 44us : add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s5 45us : sub_preempt_count (local_bh_enable)
-[...]
- sshd-4261 0d.s. 63us : _local_bh_enable (__do_softirq)
- sshd-4261 0d.s1 64us : trace_preempt_on (__do_softirq)
-
-
-The above is an example of the preemptoff trace with
-ftrace_enabled set. Here we see that interrupts were disabled
-the entire time. The irq_enter code lets us know that we entered
-an interrupt 'h'. Before that, the functions being traced still
-show that it is not in an interrupt, but we can see from the
-functions themselves that this is not the case.
-
-Notice that __do_softirq when called does not have a
-preempt_count. It may seem that we missed a preempt enabling.
-What really happened is that the preempt count is held on the
-thread's stack and we switched to the softirq stack (4K stacks
-in effect). The code does not copy the preempt count, but
-because interrupts are disabled, we do not need to worry about
-it. Having a tracer like this is good for letting people know
-what really happens inside the kernel.
-
-
-preemptirqsoff
---------------
-
-Knowing the locations that have interrupts disabled or
-preemption disabled for the longest times is helpful. But
-sometimes we would like to know when either preemption and/or
-interrupts are disabled.
-
-Consider the following code:
-
- local_irq_disable();
- call_function_with_irqs_off();
- preempt_disable();
- call_function_with_irqs_and_preemption_off();
- local_irq_enable();
- call_function_with_preemption_off();
- preempt_enable();
-
-The irqsoff tracer will record the total length of
-call_function_with_irqs_off() and
-call_function_with_irqs_and_preemption_off().
-
-The preemptoff tracer will record the total length of
-call_function_with_irqs_and_preemption_off() and
-call_function_with_preemption_off().
-
-But neither will trace the time that interrupts and/or
-preemption is disabled. This total time is the time that we can
-not schedule. To record this time, use the preemptirqsoff
-tracer.
-
-Again, using this trace is much like the irqsoff and preemptoff
-tracers.
-
- # echo preemptirqsoff > /debug/tracing/current_tracer
- # echo 0 > /debug/tracing/tracing_max_latency
- # echo 1 > /debug/tracing/tracing_enabled
- # ls -ltr
- [...]
- # echo 0 > /debug/tracing/tracing_enabled
- # cat /debug/tracing/latency_trace
-# tracer: preemptirqsoff
-#
-preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 293 us, #3/3, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: ls-4860 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: apic_timer_interrupt
- => ended at: __do_softirq
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- ls-4860 0d... 0us!: trace_hardirqs_off_thunk (apic_timer_interrupt)
- ls-4860 0d.s. 294us : _local_bh_enable (__do_softirq)
- ls-4860 0d.s1 294us : trace_preempt_on (__do_softirq)
-
-
-
-The trace_hardirqs_off_thunk is called from assembly on x86 when
-interrupts are disabled in the assembly code. Without the
-function tracing, we do not know if interrupts were enabled
-within the preemption points. We do see that it started with
-preemption enabled.
-
-Here is a trace with ftrace_enabled set:
-
-
-# tracer: preemptirqsoff
-#
-preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8
---------------------------------------------------------------------
- latency: 105 us, #183/183, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:2)
- -----------------
- | task: sshd-4261 (uid:0 nice:0 policy:0 rt_prio:0)
- -----------------
- => started at: write_chan
- => ended at: __do_softirq
-
-# _------=> CPU#
-# / _-----=> irqs-off
-# | / _----=> need-resched
-# || / _---=> hardirq/softirq
-# ||| / _--=> preempt-depth
-# |||| /
-# ||||| delay
-# cmd pid ||||| time | caller
-# \ / ||||| \ | /
- ls-4473 0.N.. 0us : preempt_schedule (write_chan)
- ls-4473 0dN.1 1us : _spin_lock (schedule)
- ls-4473 0dN.1 2us : add_preempt_count (_spin_lock)
- ls-4473 0d..2 2us : put_prev_task_fair (schedule)
-[...]
- ls-4473 0d..2 13us : set_normalized_timespec (ktime_get_ts)
- ls-4473 0d..2 13us : __switch_to (schedule)
- sshd-4261 0d..2 14us : finish_task_switch (schedule)
- sshd-4261 0d..2 14us : _spin_unlock_irq (finish_task_switch)
- sshd-4261 0d..1 15us : add_preempt_count (_spin_lock_irqsave)
- sshd-4261 0d..2 16us : _spin_unlock_irqrestore (hrtick_set)
- sshd-4261 0d..2 16us : do_IRQ (common_interrupt)
- sshd-4261 0d..2 17us : irq_enter (do_IRQ)
- sshd-4261 0d..2 17us : idle_cpu (irq_enter)
- sshd-4261 0d..2 18us : add_preempt_count (irq_enter)
- sshd-4261 0d.h2 18us : idle_cpu (irq_enter)
- sshd-4261 0d.h. 18us : handle_fasteoi_irq (do_IRQ)
- sshd-4261 0d.h. 19us : _spin_lock (handle_fasteoi_irq)
- sshd-4261 0d.h. 19us : add_preempt_count (_spin_lock)
- sshd-4261 0d.h1 20us : _spin_unlock (handle_fasteoi_irq)
- sshd-4261 0d.h1 20us : sub_preempt_count (_spin_unlock)
-[...]
- sshd-4261 0d.h1 28us : _spin_unlock (handle_fasteoi_irq)
- sshd-4261 0d.h1 29us : sub_preempt_count (_spin_unlock)
- sshd-4261 0d.h2 29us : irq_exit (do_IRQ)
- sshd-4261 0d.h2 29us : sub_preempt_count (irq_exit)
- sshd-4261 0d..3 30us : do_softirq (irq_exit)
- sshd-4261 0d... 30us : __do_softirq (do_softirq)
- sshd-4261 0d... 31us : __local_bh_disable (__do_softirq)
- sshd-4261 0d... 31us+: add_preempt_count (__local_bh_disable)
- sshd-4261 0d.s4 34us : add_preempt_count (__local_bh_disable)
-[...]
- sshd-4261 0d.s3 43us : sub_preempt_count (local_bh_enable_ip)
- sshd-4261 0d.s4 44us : sub_preempt_count (local_bh_enable_ip)
- sshd-4261 0d.s3 44us : smp_apic_timer_interrupt (apic_timer_interrupt)
- sshd-4261 0d.s3 45us : irq_enter (smp_apic_timer_interrupt)
- sshd-4261 0d.s3 45us : idle_cpu (irq_enter)
- sshd-4261 0d.s3 46us : add_preempt_count (irq_enter)
- sshd-4261 0d.H3 46us : idle_cpu (irq_enter)
- sshd-4261 0d.H3 47us : hrtimer_interrupt (smp_apic_timer_interrupt)
- sshd-4261 0d.H3 47us : ktime_get (hrtimer_interrupt)
-[...]
- sshd-4261 0d.H3 81us : tick_program_event (hrtimer_interrupt)
- sshd-4261 0d.H3 82us : ktime_get (tick_program_event)
- sshd-4261 0d.H3 82us : ktime_get_ts (ktime_get)
- sshd-4261 0d.H3 83us : getnstimeofday (ktime_get_ts)
- sshd-4261 0d.H3 83us : set_normalized_timespec (ktime_get_ts)
- sshd-4261 0d.H3 84us : clockevents_program_event (tick_program_event)
- sshd-4261 0d.H3 84us : lapic_next_event (clockevents_program_event)
- sshd-4261 0d.H3 85us : irq_exit (smp_apic_timer_interrupt)
- sshd-4261 0d.H3 85us : sub_preempt_count (irq_exit)
- sshd-4261 0d.s4 86us : sub_preempt_count (irq_exit)
- sshd-4261 0d.s3 86us : add_preempt_count (__local_bh_disable)
-[...]
- sshd-4261 0d.s1 98us : sub_preempt_count (net_rx_action)
- sshd-4261 0d.s. 99us : add_preempt_count (_spin_lock_irq)
- sshd-4261 0d.s1 99us+: _spin_unlock_irq (run_timer_softirq)
- sshd-4261 0d.s. 104us : _local_bh_enable (__do_softirq)
- sshd-4261 0d.s. 104us : sub_preempt_count (_local_bh_enable)
- sshd-4261 0d.s. 105us : _local_bh_enable (__do_softirq)
- sshd-4261 0d.s1 105us : trace_preempt_on (__do_softirq)
-
-
-This is a very interesting trace. It started with the preemption
-of the ls task. We see that the task had the "need_resched" bit
-set via the 'N' in the trace. Interrupts were disabled before
-the spin_lock at the beginning of the trace. We see that a
-schedule took place to run sshd. When the interrupts were
-enabled, we took an interrupt. On return from the interrupt
-handler, the softirq ran. We took another interrupt while
-running the softirq as we see from the capital 'H'.
-
-
wakeup
------
--
1.6.0.6
^ permalink raw reply related
* Re: r8169 MAC problem
From: Tim Durack @ 2009-03-07 14:48 UTC (permalink / raw)
To: Francois Romieu; +Cc: linux-kernel, netdev, Ivan Vecera
In-Reply-To: <20090306200515.GA26365@electric-eye.fr.zoreil.com>
On Fri, Mar 6, 2009 at 3:05 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> Please Cc: Ivan.
>
> Tim Durack <tdurack@gmail.com> :
> [...]
>> Any ideas?
>
> Damn me, I should have noticed that the delay was below spec :o(
>
> Can you try the patch below on top of the current git kernel ?
Patch didn't apply cleanly, so I did it by hand.
My kernel patch/compile skills are a little rusty, so I'm still in the
process of testing...
Tim:>
^ permalink raw reply
* Re: [RFC] FC pass thru - Rev V
From: James Smart @ 2009-03-07 14:44 UTC (permalink / raw)
To: Seokmann Ju
Cc: futjita.tomonori@lab.ntt.co.jp, Andrew Vasquez,
sven@linux.vnet.ibm.com, bharrosh@panasas.com,
linux-scsi@vger.kernel.org, Smart, James
In-Reply-To: <968C4C03B4940B48A4A8B1EA417CD6D82D2639A19E@AVEXMB2.qlogic.org>
Seokmann Ju wrote:
>> From: James Smart [mailto:James.Smart@Emulex.Com]
>> Sent: Wednesday, February 11, 2009 7:14 AM
>>
>> Trying to kick-start this again...
>> I've updated the prior RFC with the comments from Seokmann,
>> SvenFujita, and Boaz. I would still like review on the
>> blk_xxx completion calls in the std and error paths.
> <snip>
>> +static int
>> +fc_bsg_map_buffer(struct fc_bsg_buffer *buf, struct request *req)
>> +{
>> + size_t sz = (sizeof(struct scatterlist) * req->nr_phys_segments);
>> +
>> + BUG_ON(!req->nr_phys_segments);
>> +
>> + buf->sg_list = kzalloc(sz, GFP_KERNEL);
>> + if (!buf->sg_list)
>> + return -ENOMEM;
>> + sg_init_table(buf->sg_list, req->nr_phys_segments);
>> + buf->sg_cnt = blk_rq_map_sg(req->q, req, buf->sg_list);
>> + buf->payload_len = req->data_len;
>> + return 0;
>> +}
> It looks like that there is possibility that the dma buffer with more
> than one sg element for ELS services - which is not allowed per FC spec.
How can the T11 FC spec ever reference anything about sg elements ? They
are completely independent.
> I've seen a couple of times from the driver testing.
> I'm looking for some ways to making sure the ELS services
> to get single sg for both request/reply_payload.
> Any comments/suggestion?
For ELS's, the payload should be small - usually <= 256bytes so it fits
within default login parameters. It should be 1 buffer, thus 1 sge.
(Note: the routine above is for any request, which covers more than just
ELS's).
If you're getting multiple sg's, then either the buffer spans some
condition that crosses a boundary that blk_rq_map_sg() enforces (like a
4G boundary, but I doubt that's it), or - and more likely - your
application has a buffer that spans 2 pages which look contiguous to the
app, but are actually virtual-memory mapped to 2 independent physical
pages (thus the need for 2 sg's). If your app knows the system page
size, and was careful about buffer placement and length within page
boundaries, it likely would never encounter this. But, we would never
want to force apps to be this smart, and this would be a good
justification for supporting more than 1 sg.
-- james s
^ permalink raw reply
* Re: [ANNOUNCE] ulogd 2.0.0beta3
From: Jan Engelhardt @ 2009-03-07 14:43 UTC (permalink / raw)
To: Harald Welte; +Cc: Pablo Neira Ayuso, netfilter-devel
In-Reply-To: <20090307103406.GB4678@prithivi.gnumonks.org>
On Saturday 2009-03-07 11:34, Harald Welte wrote:
>On Fri, Mar 06, 2009 at 07:09:36PM +0100, Pablo Neira Ayuso wrote:
>> Link ulogd2 with libpthread
>
>I was just reading this and all alarm sirens went on. I don't know
>why that is neccessary, and I hope it is just due to some library dependency.
>
>When I created ulogd and ulogd2, I never intended them to become some kind of
>multi-threaded monster with a complex locking and synchronization nightmare.
Yeah there seems to be not a single pthread_ call or type in use,
so I wonder why it was done.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.