* Re: [Qemu-devel] Unified device model
From: Jim C. Brown @ 2006-04-09 14:55 UTC (permalink / raw)
To: qemu-devel
In-Reply-To: <200604091138.31242.paul@codesourcery.com>
On Sun, Apr 09, 2006 at 11:38:28AM +0100, Paul Brook wrote:
> I think to be acceptable to qemu (and probably also for Xen) the devices would
> have to be written in C. C++ is more pain that it's worth in this context.
> Of course there's no reason why we couldn't use the subset of C that's also
> valid C++. You could also write C++ wrappers round the interface for bochs to
> use.
>
Same here.
> I'm not a fan of binary plugins (for the same reasons I'm don't like binary
> kernel modules), and don't think there's any real need to them.
A binary plugin API and a source plugin API (one that requires each driver
device to be recompiled for each of the platforms (Xen, qemu, bochs, etc.)
would probably be equally hard to design and maintain.
With a binary plugin API you at least win out.
> I can't see
> any good reasons why open source devices would need to be broken out into a
> separate shared library.
>
I think the case was already made for this.
Xen's hardware emulation, while based on qemu's, is already ahead in several
aspects. A separate library would make it more convenient for these changes
to be shared back with qemu. Or with E/OS.
This is actually a completely separate issue from a unified device driver API
(as qemu could support the API, but only in source code form, or could require
that drivers be linked in statically, etc) and should be recognized as such.
> If you do want to accommodate proprietary binary plugins then C++ is a really
> bad idea. The C++/libstdc++ ABI simply isn't stable enough to make this a
> realistic option.
Considering that the ABI does not guarantee compatibility between versions, I
am inclined to agree.
No reason the drivers themselves can't be done in C++, but the API itself
should be pure C.
>
> Paul
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
^ permalink raw reply
* [-mm patch] drivers/char/drm/drm_memory.c: possible cleanups
From: Adrian Bunk @ 2006-04-09 14:58 UTC (permalink / raw)
To: Andrew Morton, airlied; +Cc: linux-kernel, dri-devel
In-Reply-To: <20060408031405.5e5131da.akpm@osdl.org>
On Sat, Apr 08, 2006 at 03:14:05AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.17-rc1-mm1:
>...
> git-drm.patch
>...
> git trees
>...
This patch contains the following possible cleanups plus the changes
caused by them:
- #if 0 the following unused global function:
- drm_ioremap_nocache()
- make the following needlessly global functions static:
- agp_remap()
- drm_lookup_map()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/char/drm/drmP.h | 4 ++--
drivers/char/drm/drm_memory.c | 25 +++++++++++++++++++++----
drivers/char/drm/drm_memory.h | 24 ------------------------
drivers/char/drm/drm_memory_debug.h | 2 ++
4 files changed, 25 insertions(+), 30 deletions(-)
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drmP.h.old 2006-04-09 16:18:20.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drmP.h 2006-04-09 16:18:38.000000000 +0200
@@ -815,8 +815,6 @@
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
extern void *drm_ioremap(unsigned long offset, unsigned long size,
drm_device_t * dev);
-extern void *drm_ioremap_nocache(unsigned long offset, unsigned long size,
- drm_device_t * dev);
extern void drm_ioremapfree(void *pt, unsigned long size, drm_device_t * dev);
extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type);
@@ -1022,11 +1020,13 @@
map->handle = drm_ioremap(map->offset, map->size, dev);
}
+#if 0
static __inline__ void drm_core_ioremap_nocache(struct drm_map *map,
struct drm_device *dev)
{
map->handle = drm_ioremap_nocache(map->offset, map->size, dev);
}
+#endif /* 0 */
static __inline__ void drm_core_ioremapfree(struct drm_map *map,
struct drm_device *dev)
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.h.old 2006-04-09 16:15:53.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.h 2006-04-09 16:21:28.000000000 +0200
@@ -57,15 +57,6 @@
# endif
#endif
-/*
- * Find the drm_map that covers the range [offset, offset+size).
- */
-drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev);
-
-void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev);
-
static inline unsigned long drm_follow_page(void *vaddr)
{
pgd_t *pgd = pgd_offset_k((unsigned long)vaddr);
@@ -77,18 +68,6 @@
#else /* __OS_HAS_AGP */
-static inline drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev)
-{
- return NULL;
-}
-
-static inline void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev)
-{
- return NULL;
-}
-
static inline unsigned long drm_follow_page(void *vaddr)
{
return 0;
@@ -99,8 +78,5 @@
void *drm_ioremap(unsigned long offset, unsigned long size,
drm_device_t * dev);
-void *drm_ioremap_nocache(unsigned long offset,
- unsigned long size, drm_device_t * dev);
-
void drm_ioremapfree(void *pt, unsigned long size,
drm_device_t * dev);
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory_debug.h.old 2006-04-09 16:19:31.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory_debug.h 2006-04-09 16:19:44.000000000 +0200
@@ -229,6 +229,7 @@
return pt;
}
+#if 0
void *drm_ioremap_nocache (unsigned long offset, unsigned long size,
drm_device_t * dev) {
void *pt;
@@ -251,6 +252,7 @@
spin_unlock(&drm_mem_lock);
return pt;
}
+#endif /* 0 */
void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
int alloc_count;
--- linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.c.old 2006-04-09 16:16:14.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/drivers/char/drm/drm_memory.c 2006-04-09 16:21:24.000000000 +0200
@@ -83,8 +83,8 @@
/*
* Find the drm_map that covers the range [offset, offset+size).
*/
-drm_map_t *drm_lookup_map(unsigned long offset,
- unsigned long size, drm_device_t * dev)
+static drm_map_t *drm_lookup_map(unsigned long offset,
+ unsigned long size, drm_device_t * dev)
{
struct list_head *list;
drm_map_list_t *r_list;
@@ -102,8 +102,8 @@
return NULL;
}
-void *agp_remap(unsigned long offset, unsigned long size,
- drm_device_t * dev)
+static void *agp_remap(unsigned long offset, unsigned long size,
+ drm_device_t * dev)
{
unsigned long *phys_addr_map, i, num_pages =
PAGE_ALIGN(size) / PAGE_SIZE;
@@ -168,6 +168,21 @@
{
return drm_agp_unbind_memory(handle);
}
+
+#else /* __OS_HAS_AGP */
+
+static inline drm_map_t *drm_lookup_map(unsigned long offset,
+ unsigned long size, drm_device_t * dev)
+{
+ return NULL;
+}
+
+static inline void *agp_remap(unsigned long offset, unsigned long size,
+ drm_device_t * dev)
+{
+ return NULL;
+}
+
#endif /* agp */
void *drm_ioremap(unsigned long offset, unsigned long size,
@@ -183,6 +198,7 @@
}
EXPORT_SYMBOL(drm_ioremap);
+#if 0
void *drm_ioremap_nocache(unsigned long offset,
unsigned long size, drm_device_t * dev)
{
@@ -194,6 +210,7 @@
}
return ioremap_nocache(offset, size);
}
+#endif /* 0 */
void drm_ioremapfree(void *pt, unsigned long size,
drm_device_t * dev)
^ permalink raw reply
* Re: [2.6 patch] drivers/isdn/capi/capiutil.c: unexport capi_message2str
From: Arjan van de Ven @ 2006-04-09 15:02 UTC (permalink / raw)
To: Karsten Keil; +Cc: Adrian Bunk, isdn4linux, linux-kernel
In-Reply-To: <20060409130730.GA27948@pingi.kke.suse.de>
On Sun, 2006-04-09 at 15:07 +0200, Karsten Keil wrote:
> On Fri, Apr 07, 2006 at 11:17:36PM +0200, Adrian Bunk wrote:
> > This patch removes an unused EXPORT_SYMBOL.
> >
> > Signed-off-by: Adrian Bunk <bunk@stusta.de>
> >
> > --- linux-2.6.17-rc1-mm1-full/drivers/isdn/capi/capiutil.c.old 2006-04-07 10:47:30.000000000 +0200
> > +++ linux-2.6.17-rc1-mm1-full/drivers/isdn/capi/capiutil.c 2006-04-07 10:47:37.000000000 +0200
> > @@ -855,5 +855,4 @@
> > EXPORT_SYMBOL(capi_cmsg_header);
> > EXPORT_SYMBOL(capi_cmd2str);
> > EXPORT_SYMBOL(capi_cmsg2str);
> > -EXPORT_SYMBOL(capi_message2str);
> > EXPORT_SYMBOL(capi_info2str);
> >
>
> Yes it is currently unused, but part of the CAPI driver SDK for supporting
> debug messages in capi drivers, so I would tend to let it exported, if here
> are not strong arguments against exporting it.
every export takes space in the binary kernel. There's some 900 of these
unused ones, totalling to about 100Kb of unused bloat.
^ permalink raw reply
* Re: Black box flight recorder for Linux
From: Andi Kleen @ 2006-04-09 15:04 UTC (permalink / raw)
To: James Courtier-Dutton; +Cc: Robert Hancock, linux-kernel
In-Reply-To: <4437E4B7.40208@superbug.co.uk>
On Saturday 08 April 2006 18:28, James Courtier-Dutton wrote:
> Andi Kleen wrote:
> > On Saturday 08 April 2006 16:05, Robert Hancock wrote:
> >> Andi Kleen wrote:
> >>> James Courtier-Dutton <James@superbug.co.uk> writes:
> >>>> Now, the question I have is, if I write values to RAM, do any of those
> >>>> values survive a reset?
> >>> They don't generally.
> >>>
> >>> Some people used to write the oopses into video memory, but that
> >>> is not portable.
> >> I wouldn't think most BIOSes these days would bother to clear system RAM
> >> on a reboot. Certainly Microsoft was encouraging vendors not to do this
> >> because it slowed down system boot time.to
> >
> > Reset button is like a cold boot and it generally ends up with cleared
> > RAM.
> >
> > -Andi
>
> Thank you. That saved me 30mins hacking. :-)
Sorry for having discouraged you.
Actually there is a rare special case - triple fault - where you
might be ok if the BIOS correctly supports the ACPI "bootflag" standard,
but triple faults are relatively rare. They happen when the
kernel screws up so badly that the CPU cannot even run exception
handlers anymore. But I suspect it's too special for this.
First if you're not aware of this - the "official" way right now
to solve this problem is kexec + kdump + a preloaded crash kernel. But in
practice it still has many problems because a lot of drivers cannot
reinitialize the hardware properly. And of course it will users need
to load the crash kernel in advance and lose about 64MB of RAM.
My personal solution to the problem is firescope, but it also has its
drawbacks (needs ohci1394 loaded first, requires a firewire cable)
What I would do for this if you want to hack.- define a generic interface that allows
drivers to register memory storage handlers. Add a entry into the oops die
and panic notifiers that saves the kernel log into these backends.
Then write some Documentation file for it and add a proof of comcept e.g. to the
Nvidia/ATI frame buffer drivers. Then driver writers could expose this functionality
if their hardware supports it or if someone has an embedded platform that
guarantees it they could also use it.
For Nvidia/ATI it might be tricky to get the
X server to keep its hands off the memory, but I assume most graphic cards
these days have more memory than the X server uses at least without 3d (?).
If you're unlucky it will fill up everything with mozilla pixmaps over time though.
In the worst case you would need to define a new interface between X server
and kernel to tell the X server to leave some memory alone.
The generic driver could also do the high level work, like adding proper
checksums and magic values to make sure the data is sane after reboot.
You would also need another driver that allows the boot process to read that
data.
Hope this helps,
-Andi
^ permalink raw reply
* [PATCH ACPI] memory leak in acpi_evaluate_integer()
From: Vasily Averin @ 2006-04-09 15:07 UTC (permalink / raw)
To: Len Brown, linux-acpi, Linux Kernel Mailing List, Andrew Morton,
Kirill Korotaev, devel
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
acpi_evaluate_integer() does not release allocated memory on the error path.
Signed-off-by: Vasily Averin <vvs@sw.ru>
Thank you,
Vasily Averin
SWsoft Virtuozzo/OpenVZ Linux kernel team
[-- Attachment #2: diff-ms-acpi-evint-20060409 --]
[-- Type: text/plain, Size: 558 bytes --]
--- a/drivers/acpi/utils.c 2006-04-09 14:31:39.000000000 +0400
+++ b/drivers/acpi/utils.c 2006-04-09 14:35:02.000000000 +0400
@@ -273,11 +273,13 @@ acpi_evaluate_integer(acpi_handle handle
status = acpi_evaluate_object(handle, pathname, arguments, &buffer);
if (ACPI_FAILURE(status)) {
acpi_util_eval_error(handle, pathname, status);
+ kfree(element);
return_ACPI_STATUS(status);
}
if (element->type != ACPI_TYPE_INTEGER) {
acpi_util_eval_error(handle, pathname, AE_BAD_DATA);
+ kfree(element);
return_ACPI_STATUS(AE_BAD_DATA);
}
^ permalink raw reply
* Re: Building a small sparc32 kernel
From: Bob Breuer @ 2006-04-09 15:05 UTC (permalink / raw)
To: sparclinux
In-Reply-To: <20060404151927.GC2358@cassis>
Ludovic Courtès wrote:
> So, I now have a 2.6.14 SMP kernel I can boot from. On my SS20, it
> doesn't even get to the point of spawning `init'. I get a number of the
> following messages at boot time:
>
> esp0: Resetting scsi bus
> esp0: SCSI bus reset interrupt
> esp0: DMA error a4400302
Are you using multiple drives? I've seen this problem before when using
multiple drives, even with a 2.6 UP kernel, but I've not had a problem
when only actively using one drive.
> And finally, I get spinlock debugging messages followed by a stack trace
> telling that something went wrong ("BUG: spinlock lockup on CPU#2",
> etc.), and nothing more. I guess I'm going to have to capture the
> console output via a serial line in order to provide you with meaningful
> data.
Try configuring the kernel with spinlock debugging turned off.
> The machine has two SuperSPARC 390Z50. In your original message you
> mentioned that support for SuperSPARC II was relatively stable, so maybe
> this just means that support for this older SuperSPARC flavor is not yet
> in such a good shape? ;-)
I think you're almost there. I don't see any reason why a pair of older
SuperSPARCs wouldn't work, but I don't have any to test against.
Bob
^ permalink raw reply
* [PATCH ACPI] memory leakages in drivers/acpi/thermal.c
From: Vasily Averin @ 2006-04-09 15:08 UTC (permalink / raw)
To: Len Brown, linux-acpi, Linux Kernel Mailing List, Andrew Morton,
Kirill Korotaev, devel
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
acpi_thermal_write_trip_points() and acpi_thermal_add() do not call kfree() for
allocated memory on the error path.
Signed-off-by: Vasily Averin <vvs@sw.ru>
Thank you,
Vasily Averin
SWsoft Virtuozzo/OpenVZ Linux kernel team
[-- Attachment #2: diff-ms-acpi-thermal-20060409 --]
[-- Type: text/plain, Size: 720 bytes --]
--- a/drivers/acpi/thermal.c 2006-04-09 17:03:50.000000000 +0400
+++ b/drivers/acpi/thermal.c 2006-04-09 17:46:41.000000000 +0400
@@ -942,8 +942,10 @@ acpi_thermal_write_trip_points(struct fi
memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
- if (!active)
+ if (!active) {
+ kfree(limit_string);
return_VALUE(-ENOMEM);
+ }
if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
@@ -1342,7 +1344,7 @@ static int acpi_thermal_add(struct acpi_
result = acpi_thermal_add_fs(device);
if (result)
- return_VALUE(result);
+ goto end;
init_timer(&tz->timer);
^ permalink raw reply
* [PATCH ACPI] memory leakages in driver/acpi/video.c
From: Vasily Averin @ 2006-04-09 15:09 UTC (permalink / raw)
To: Len Brown, linux-acpi, Kirill Korotaev, devel
[-- Attachment #1: Type: text/plain, Size: 459 bytes --]
Unlike my previously patches this one is not trivial and it is not tested
properly. I'm not an expert in ACPI-related questions therefore this patch may
be wrong.
Len, could you please check it carefully?
acpi_video_bus_get_one_device() and other functions in driver/acpi/video.c do
not release allocated memory on remove and on the error path.
Signed-off-by: Vasily Averin <vvs@sw.ru>
Thank you,
Vasily Averin
SWsoft Virtuozzo/OpenVZ Linux kernel team
[-- Attachment #2: diff-ms-acpi-video-20060409 --]
[-- Type: text/plain, Size: 1677 bytes --]
--- a/drivers/acpi/video.c 2006-03-20 08:53:29.000000000 +0300
+++ b/drivers/acpi/video.c 2006-04-09 18:34:38.000000000 +0400
@@ -1294,7 +1294,7 @@ acpi_video_bus_get_one_device(struct acp
struct acpi_video_bus *video)
{
unsigned long device_id;
- int status, result;
+ int status;
struct acpi_video_device *data;
ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device");
@@ -1346,8 +1346,11 @@ acpi_video_bus_get_one_device(struct acp
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
- result = -ENODEV;
- goto end;
+ if(data->brightness)
+ kfree(data->brightness->levels);
+ kfree(data->brightness);
+ kfree(data);
+ return_VALUE(-ENODEV);
}
down(&video->sem);
@@ -1358,8 +1361,6 @@ acpi_video_bus_get_one_device(struct acp
return_VALUE(0);
}
-
- end:
return_VALUE(-ENOENT);
}
@@ -1643,8 +1644,9 @@ static int acpi_video_bus_put_devices(st
printk(KERN_WARNING PREFIX
"hhuuhhuu bug in acpi video driver.\n");
+ if (data->brightness);
+ kfree(data->brightness->levels);
kfree(data->brightness);
-
kfree(data);
}
@@ -1785,6 +1787,10 @@ static int acpi_video_bus_add(struct acp
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
+ acpi_video_bus_stop_devices(video);
+ acpi_video_bus_put_devices(video);
+ kfree(video->attached_array);
+ acpi_video_bus_remove_fs(device);
result = -ENODEV;
goto end;
}
@@ -1797,7 +1803,6 @@ static int acpi_video_bus_add(struct acp
end:
if (result) {
- acpi_video_bus_remove_fs(device);
kfree(video);
}
^ permalink raw reply
* Re: [Xenomai-core] latency -t 1 crashes on SMP.
From: Jan Kiszka @ 2006-04-09 15:07 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
In-Reply-To: <17465.8101.106079.634470@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]
Gilles Chanteperdrix wrote:
> I tried latency -t 1 on an SMP machines, and observed a very
> reproducible crash. Most of the time, the machine locks up
> completely. The rest of the time, I get :
>
> Xenomai: suspending kernel thread e7559044 ('timerbench') at 0xb01051f2 after ex
> ception #14
>
> And the system remains runnable, but 0xb01051f2 is not a valid kernel
> module text address.
>
> The lock up does not seem to be detected by any Xenomai or Linux
> debug or watchdog. Only enabling the NMI watchdog seems to
> systematically produce the exception 14 instead of the lockup.
>
> I ve tried to put a printk at the beginning of timer_task_proc outer
> loop. It get printed once when getting the exception 14, and twice when
> getting the lock up.
>
> Any idea where to look ?
>
Two proposals to collect information:
o give KGDB a try
o instrument the xenomai exception handler with an ipipe_trace_freeze()
(something which should be merged into SVN later)
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply
* RE: [RFC] Hypercalls from HVM guests
From: Nakajima, Jun @ 2006-04-09 15:08 UTC (permalink / raw)
To: Keir Fraser; +Cc: Steve Ofsthun, xen-devel
Keir Fraser wrote:
> On 9 Apr 2006, at 14:56, Nakajima, Jun wrote:
>
>> This is a different question, and I think detecting a virtual device
>> (i.e. virtual block device, NIC) or chipset would be a cleaner way at
>> this point. And that would be proper for the patch that Steve
>> mentioned (we wrote it). The fact that it's running on a hypervisor
>> does not necessarily guarantee presence of such virtual devices (in
>> fact they don't exist today ;-).
>>
>> If we really need to tell if we are running on a hypervisor at a very
>> early point or even in user-mode, I think CPUID with "an unused
>> index" would be the simplest, but so far I haven't seen any usage
>> models that really require that. If we want to add virtualization
>> hints for processor architectures (e.g. MMU) in guests, it would be
>> needed.
>
> Executing hypercalls via an indirection page as we do for
> paravirtualised guests is an attractive idea. That would require more
> than just 'are we AMD or Intel' and it would be nice to have that
> future-proofing level of indirection in the initial implementation. We
> could do that via the PCI device too (e.g., use a BAR) though that
> doesn't seem so clean to me.
>
> -- Keir
Yep. We should not use PCI device detection to detect such Xen-specific
MMU features. And we should use PCI device detection to detect a virtual
device because the guest needs to initialize and set up the plumbing
(e.g. interrupt lines) as a device.
I think such an initial implementation for Xen MMU can use CPUID (with
whatever index), and I think we can come back with a specific value for
the index when a patch is ready.
Jun
---
Intel Open Source Technology Center
^ permalink raw reply
* [Patch] Dont call ac97_release_codec with NULL argument in
From: Eric Sesterhenn @ 2006-04-09 15:09 UTC (permalink / raw)
To: linux-sound
hi,
this is a fix for coverity id #243. We only jump to err_codec
if ac97_alloc_codec() fails its malloc() in which case codec is NULL.
Since ac97_release_codec dereferences its argument we shouldnt call
it with a NULL argument.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.17-rc1/sound/oss/es1371.c.orig 2006-04-09 17:03:22.000000000 +0200
+++ linux-2.6.17-rc1/sound/oss/es1371.c 2006-04-09 17:03:55.000000000 +0200
@@ -3040,8 +3040,8 @@ static int __devinit es1371_probe(struct
err_irq:
release_region(s->io, ES1371_EXTENT);
err_region:
- err_codec:
ac97_release_codec(s->codec);
+ err_codec:
kfree(s);
return res;
}
^ permalink raw reply
* Re: [Qemu-devel] Unified device model
From: Jim C. Brown @ 2006-04-09 15:10 UTC (permalink / raw)
To: qemu-devel
In-Reply-To: <E1FSSRx-0004OR-Eg@lists.gnu.org>
On Sun, Apr 09, 2006 at 08:26:11AM +0200, Stanislav Shwartsman wrote:
> I am talking about the device models only. Inside CPU emulation QEMU, Bochs
> and Xen are completely different, but they use the same devices for full
> system emulation and they most likely want to move forward together.
I haven't kept up with Bochs lately, so I have no idea if what qemu emulates
and what Bochs emulates are still the same or if the devices supported have
divulged.
I do know that the code is completely different (they aren't even in the same
language!).
This part of the discussion is getting offtopic tho - how devices are done
right now is not important.
> The
> devices system of QEMU and Bochs become outdate, it is required to add ACPI
> compliance and emulate new modern ACPI compatible devices, currently
> emulated i440FX already not so represent the real life and most of the
> modern OSes already have no support for it.
>
Agreed.
> So may we should ;)
Agreed.
> At least I see the code changes from Bochs migrating to QEMU and vise versa
> when I am looking into the code.
>
You do?
I wasn't aware that bochs took anything from qemu, and the only piece of code
that I know that is shared between the two is for the bios.
> Why not ?
> You always could consider to add simple modules C++ to QEMU or build C++
> device -> C device interface bridge ...
> I don't know all the possibilities, but I am sure there are more.
C++ code in qemu is forbidden (by the author and maintainer).
So a plugin API based on C sounds like the best option.
Bochs is unique as it is the only active open source PC emulator/virtualizer that
is done in C++. So "Bochs has C++ support" is not a good reason for the API
to be based on C++.
>
> >>I know about two professional teams working in simulation which would like
> >>to use these device models in their simulator and
> >>could enrich the device library with new devices device interfaces, for
> >>example with AGP and 3D graphics.
> >>Bochs is already in middle of definition of new true pluginable devices
> >>architecture.
>
> >This is welcome news.
>
> Currently we are thinking about making user-plugin PCI devices and when
> later user-plugin for any device. The C++ hierarchy for now might be:
> bx_devmodel_c - bx_pcidev_c - bx_user_pcidev_c
>
> The plans are to take one of the Bochs PCI devices and convert it into
> user-level plugin which should not be compiled with Bochs and even not known
> at compile time, but loaded at runtime if selected in runtime config file.
Why only PCI devices?
Why not USB, ISA (keyboard, monitor, pc speaker), devices that attach to the
serial port (like the current wacom patch), etc?
Also note that it is possible to use C to set up such a hierarchy - perhaps
not as natural as in C++, but still doable.
> When any other device models could be added, even with closed-sources and
> commercial licenses.
I don't support this.
Under what circumstances would commercial qemu/xen/bochs/eos driver devices
be a good thing?
I can understand (tho I still dislike) having commercial drivers in say
the kernel - if its the only way to get support for a particular device, and
that device would make it easier for others to use a different OS (e.g.
nvidia under linux so ppl can have good 3d support) then I find it acceptable
and tolerable.
But why would we want to do this for qemu et. al.?
>
> >The primary reason given for not making a plugin API for qemu hardware
> >emulationis that qemu isn't stable enough - the code changes too often to
> >support a stable API.
>
> >Still, it might be easier to add support for plugins based on an external
> >API, rather than trying to keep a qemu plugin API consistent.
>
> Ok, I didn't knew that QEMU is so unstable. But at least there are several
> trivial requirements from plugin architecture which you could mention here
> and I am still not thought about it. I know, basically I am writing the
> definition in my idle time and Volker supporting me. But it is not enough
> ...
If I think of anything else, I'll let you know. I do want to see this happen.
>
> Thanks,
> Stanislav
>
>
>
>
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
^ permalink raw reply
* Re: Socket udev events (noobie)
From: Moshe Yudkowsky @ 2006-04-09 15:13 UTC (permalink / raw)
To: linux-hotplug
In-Reply-To: <3a0f1c620604090727u14cff44au47a61c7191a553da@mail.gmail.com>
>> My question is : which are the eventes which their name
>> is "socket:"?
>
> These are not special events, these are RUN keys with the prefix
> "socket:" plus the name of an abstract namespace socket where the
> event is passed to instead of forking a program.
>
> Udevmonitor is connected like this:
> RUN+="socket:/org/kernel/udev/monitor"
>
> It listens on the socket with the specified name.
Are these documented somewhere?
--
Moshe Yudkowsky
work: http://www.Disaggregate.com
book: http://www.PebbleAndAvalanche.com
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply
* Re: [Qemu-devel] Absolute USB-HID device musings (was Re: VNC Terminal Server)
From: Jim C. Brown @ 2006-04-09 15:14 UTC (permalink / raw)
To: qemu-devel
In-Reply-To: <44388F43.20207@us.ibm.com>
On Sat, Apr 08, 2006 at 11:36:19PM -0500, Anthony Liguori wrote:
> I was looking through the Xorg evdev driver and it doesn't appear to
> support absolute coordinate reporting. evdev is how the USB mouse would
> show up to userspace. A little googling confirmed it for me:
Doesn't look like a major issue. Sounds like someone is working on making
evdev support absolute coordinates, and in the worse case it would be really
trival to use something like malc_'s patch in order to make it work.
As long as the closed source OSes support it, I think we should go for it.
>
> Regards,
>
> Anthony Liguori
>
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
^ permalink raw reply
* reading time value in dom0 and domU kernels
From: sanjay kumar @ 2006-04-09 15:19 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 611 bytes --]
Hi Folks,
I want to calculate latency in transferring a buffer from domU kernel to
dom0 kernel and vice versa. for that I need a time 'flavour' (cycle counter
time?) which reads the same in dom0 and domU. Could someone please let me
know if cycle counter time is the right time to use? if not then which one
(system time or wall clock time)? Also could someone please tell me how to
read to read this timer value.
if I use rdtsc() in both dom0 and domU, will it give me the same time value?
Thanks,
Sanjay
--
----------------------
PhD Student, Georgia Tech
http://www.cc.gatech.edu/~ksanjay/
[-- Attachment #1.2: Type: text/html, Size: 697 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply
* Re: [Qemu-devel] Unified device model
From: Paul Brook @ 2006-04-09 15:21 UTC (permalink / raw)
To: qemu-devel
In-Reply-To: <20060409145555.GA5081@jbrown.mylinuxbox.org>
> > I'm not a fan of binary plugins (for the same reasons I'm don't like
> > binary kernel modules), and don't think there's any real need to them.
>
> A binary plugin API and a source plugin API (one that requires each driver
> device to be recompiled for each of the platforms (Xen, qemu, bochs, etc.)
> would probably be equally hard to design and maintain.
You've missed my point. The only reason I can see for wanting binary plugins
is so that people can distribute proprietary closed-source device emulation.
A stable source API is a prerequisite for any sort of binary plugins.
> > I can't see
> > any good reasons why open source devices would need to be broken out into
> > a separate shared library.
>
> I think the case was already made for this.
>
> Xen's hardware emulation, while based on qemu's, is already ahead in
> several aspects. A separate library would make it more convenient for these
> changes to be shared back with qemu. Or with E/OS.
I don't buy that. We either share the same drivers (in which case keeping the
two in sync is trivial) or we don't. All of the systems under consideration
are [L]GPL licences. We can easily copy the source, so I don't think being
able to copy bits of binary goo gains us anything.
I don't think executable size is a valid argument either. Device emulation
code generally isn't that big so the overhead of breaking it up into multiple
shared libraries would outweigh the benefits of not loading the bits you're
not using.
Paul
^ permalink raw reply
* [PATCH 0/19] kconfig patches
From: Roman Zippel @ 2006-04-09 15:26 UTC (permalink / raw)
To: linux-kernel, Andrew Morton, Sam Ravnborg
Hi,
Here is a batch of kconfig (and also some kbuild related) patches. The
first four patches I'd like to see to go into 2.6.17 if possible. Although
I'm quite confident about the remaining patches, a bit more testing can't
hurt.
Some comments about the most interesting aspects from a user perspective
for these patches:
Now it's possible to do something like "vi .config; make" and be
reasonably certain it does the right thing, before especially kbuild
related config changes were not correctly picked up by make and required
an explicit "make oldconfig".
Andrew, what might be very interesting for you is that kconfig is not
rewriting .config anymore all the time by itself and if you set
KCONFIG_NOSILENTUPDATE you can even omit the silent updates, so unless you
explicitly call one of the config targets, you can be sure kbuild won't
touch your .config symlink anymore and as long as the .config is in sync
with the Kconfig files you shouldn't see a difference. I'm very interested
how that works for you.
Another interesting feature are the xconfig changes, it supports now a
search option like menuconfig and the help output links to other symbols,
so one can basically browse through the kconfig info. The latter is still
a bit experimental, so it's only visible if the debug info option is
enabled.
bye, Roman
^ permalink raw reply
* [PATCH 1/19] kconfig: fix default value for choice input
From: Roman Zippel @ 2006-04-09 15:26 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
The wrong default value can cause conf to end up in endless loop for choice
questions.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/conf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-2.6-git/scripts/kconfig/conf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/conf.c
+++ linux-2.6-git/scripts/kconfig/conf.c
@@ -328,8 +328,7 @@ static int conf_choice(struct menu *menu
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
def_sym = sym_get_choice_value(sym);
cnt = def = 0;
- line[0] = '0';
- line[1] = 0;
+ line[0] = 0;
for (child = menu->list; child; child = child->next) {
if (!menu_is_visible(child))
continue;
^ permalink raw reply
* [PATCH 2/19] kconfig: revert conf behaviour change
From: Roman Zippel @ 2006-04-09 15:26 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
After the last patch fixed the real problem, revert this needless behaviour
change of conf, which only hid the real problem.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/conf.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
Index: linux-2.6-git/scripts/kconfig/conf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/conf.c
+++ linux-2.6-git/scripts/kconfig/conf.c
@@ -63,20 +63,6 @@ static void check_stdin(void)
}
}
-static char *fgets_check_stream(char *s, int size, FILE *stream)
-{
- char *ret = fgets(s, size, stream);
-
- if (ret == NULL && feof(stream)) {
- printf(_("aborted!\n\n"));
- printf(_("Console input is closed. "));
- printf(_("Run 'make oldconfig' to update configuration.\n\n"));
- exit(1);
- }
-
- return ret;
-}
-
static void conf_askvalue(struct symbol *sym, const char *def)
{
enum symbol_type type = sym_get_type(sym);
@@ -114,7 +100,7 @@ static void conf_askvalue(struct symbol
check_stdin();
case ask_all:
fflush(stdout);
- fgets_check_stream(line, 128, stdin);
+ fgets(line, 128, stdin);
return;
case set_default:
printf("%s\n", def);
@@ -369,7 +355,7 @@ static int conf_choice(struct menu *menu
check_stdin();
case ask_all:
fflush(stdout);
- fgets_check_stream(line, 128, stdin);
+ fgets(line, 128, stdin);
strip(line);
if (line[0] == '?') {
printf("\n%s\n", menu->sym->help ?
^ permalink raw reply
* [PATCH 3/19] kconfig: recenter menuconfig
From: Roman Zippel @ 2006-04-09 15:27 UTC (permalink / raw)
To: linux-kernel, Andrew Morton, Sam Ravnborg
Move the menuconfig output more into the centre again, it's using a
fixed position depending on the window width using the fact that the
menu output has to work in a 80 chars terminal.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/lxdialog/menubox.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
Index: linux-2.6-git/scripts/kconfig/lxdialog/menubox.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/lxdialog/menubox.c
+++ linux-2.6-git/scripts/kconfig/lxdialog/menubox.c
@@ -58,8 +58,7 @@
#include "dialog.h"
-#define ITEM_IDENT 1 /* Indent of menu entries. Fixed for all menus */
-static int menu_width;
+static int menu_width, item_x;
/*
* Print menu item
@@ -70,7 +69,7 @@ static void do_print_item(WINDOW * win,
int j;
char *menu_item = malloc(menu_width + 1);
- strncpy(menu_item, item, menu_width - ITEM_IDENT);
+ strncpy(menu_item, item, menu_width - item_x);
menu_item[menu_width] = 0;
j = first_alpha(menu_item, "YyNnMmHh");
@@ -87,13 +86,13 @@ static void do_print_item(WINDOW * win,
wclrtoeol(win);
#endif
wattrset(win, selected ? item_selected_attr : item_attr);
- mvwaddstr(win, choice, ITEM_IDENT, menu_item);
+ mvwaddstr(win, choice, item_x, menu_item);
if (hotkey) {
wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
- mvwaddch(win, choice, ITEM_IDENT + j, menu_item[j]);
+ mvwaddch(win, choice, item_x + j, menu_item[j]);
}
if (selected) {
- wmove(win, choice, ITEM_IDENT + 1);
+ wmove(win, choice, item_x + 1);
}
free(menu_item);
wrefresh(win);
@@ -227,6 +226,8 @@ int dialog_menu(const char *title, const
draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2,
menubox_border_attr, menubox_attr);
+ item_x = (menu_width - 70) / 2;
+
/* Set choice to default item */
for (i = 0; i < item_no; i++)
if (strcmp(current, items[i * 2]) == 0)
@@ -263,10 +264,10 @@ int dialog_menu(const char *title, const
wnoutrefresh(menu);
print_arrows(dialog, item_no, scroll,
- box_y, box_x + ITEM_IDENT + 1, menu_height);
+ box_y, box_x + item_x + 1, menu_height);
print_buttons(dialog, height, width, 0);
- wmove(menu, choice, ITEM_IDENT + 1);
+ wmove(menu, choice, item_x + 1);
wrefresh(menu);
while (key != ESC) {
@@ -349,7 +350,7 @@ int dialog_menu(const char *title, const
print_item(scroll + choice, choice, TRUE);
print_arrows(dialog, item_no, scroll,
- box_y, box_x + ITEM_IDENT + 1, menu_height);
+ box_y, box_x + item_x + 1, menu_height);
wnoutrefresh(dialog);
wrefresh(menu);
^ permalink raw reply
* [PATCH 4/19] kconfig: fix typo in change count initialization
From: Roman Zippel @ 2006-04-09 15:27 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/confdata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6-git/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/confdata.c
+++ linux-2.6-git/scripts/kconfig/confdata.c
@@ -325,7 +325,7 @@ int conf_read(const char *name)
sym->flags |= e->right.sym->flags & SYMBOL_NEW;
}
- sym_change_count = conf_warnings && conf_unsaved;
+ sym_change_count = conf_warnings || conf_unsaved;
return 0;
}
^ permalink raw reply
* [PATCH 5/19] kconfig: improve config load/save output
From: Roman Zippel @ 2006-04-09 15:27 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
During loading special case the first common case (.config), be silent
about it and otherwise mark it as a change that requires saving. Instead
output that the file has been changed.
IOW if conf does nothing (special), it's silent.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/confdata.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
Index: linux-2.6-git/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/confdata.c
+++ linux-2.6-git/scripts/kconfig/confdata.c
@@ -98,20 +98,28 @@ int conf_read_simple(const char *name)
in = zconf_fopen(name);
} else {
const char **names = conf_confnames;
+ name = *names++;
+ if (!name)
+ return 1;
+ in = zconf_fopen(name);
+ if (in)
+ goto load;
+ sym_change_count++;
while ((name = *names++)) {
name = conf_expand_value(name);
in = zconf_fopen(name);
if (in) {
printf(_("#\n"
- "# using defaults found in %s\n"
- "#\n"), name);
- break;
+ "# using defaults found in %s\n"
+ "#\n"), name);
+ goto load;
}
}
}
if (!in)
return 1;
+load:
conf_filename = name;
conf_lineno = 0;
conf_warnings = 0;
@@ -275,6 +283,8 @@ int conf_read(const char *name)
struct expr *e;
int i;
+ sym_change_count = 0;
+
if (conf_read_simple(name))
return 1;
@@ -325,7 +335,7 @@ int conf_read(const char *name)
sym->flags |= e->right.sym->flags & SYMBOL_NEW;
}
- sym_change_count = conf_warnings || conf_unsaved;
+ sym_change_count += conf_warnings || conf_unsaved;
return 0;
}
@@ -524,6 +534,10 @@ int conf_write(const char *name)
if (rename(newname, tmpname))
return 1;
+ printf(_("#\n"
+ "# configuration written to %s\n"
+ "#\n"), tmpname);
+
sym_change_count = 0;
return 0;
^ permalink raw reply
* [PATCH 6/19] kconfig: fix .config dependencies
From: Roman Zippel @ 2006-04-09 15:28 UTC (permalink / raw)
To: linux-kernel, Andrew Morton, Sam Ravnborg
This fixes one of the worst kbuild warts left - the broken dependencies
used to check and regenerate the .config file. This was done via an
indirect dependency and the .config itself had an empty command, which
can cause make not to reread the changed .config file.
Instead of this we generate now a new file include/config/auto.conf from
.config, which is used for kbuild and has the proper dependencies. It's
also the main make target now for all files generated during this step
(and thus replaces include/linux/autoconf.h).
This also means we can now relax the syntax requirements for the .config
file and we don't have to rewrite it all the time, i.e. silentoldconfig
only writes .config now when it's necessary to keep it in sync with the
Kconfig files and even this can be suppressed by setting the environment
variable KCONFIG_NOSILENTUPDATE, so the update can (and must) be done
manually.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
Makefile | 27 ++----
scripts/Makefile.build | 2
scripts/Makefile.modpost | 2
scripts/kconfig/conf.c | 16 +++
scripts/kconfig/confdata.c | 177 ++++++++++++++++++++++++++++++--------------
scripts/kconfig/lkc_proto.h | 1
scripts/kconfig/util.c | 4
7 files changed, 156 insertions(+), 73 deletions(-)
Index: linux-2.6-git/Makefile
===================================================================
--- linux-2.6-git.orig/Makefile
+++ linux-2.6-git/Makefile
@@ -406,7 +406,7 @@ include $(srctree)/arch/$(ARCH)/Makefile
export KBUILD_DEFCONFIG
config %config: scripts_basic outputmakefile FORCE
- $(Q)mkdir -p include/linux
+ $(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
@@ -423,8 +423,6 @@ PHONY += scripts
scripts: scripts_basic include/config/MARKER
$(Q)$(MAKE) $(build)=$(@)
-scripts_basic: include/linux/autoconf.h
-
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
@@ -438,25 +436,22 @@ ifeq ($(dot-config),1)
# Read in dependencies to all Kconfig* files, make sure to run
# oldconfig if changes are detected.
--include .kconfig.d
-
-include .config
+-include include/config/auto.conf.cmd
+-include include/config/auto.conf
-# If .config needs to be updated, it will be done via the dependency
-# that autoconf has on .config.
# To avoid any implicit rule to kick in, define an empty command
-.config .kconfig.d: ;
+.config include/config/auto.conf.cmd: ;
-# If .config is newer than include/linux/autoconf.h, someone tinkered
+# If .config is newer than include/config/auto.conf, someone tinkered
# with it and forgot to run make oldconfig.
-# If kconfig.d is missing then we are probarly in a cleaned tree so
+# if auto.conf.cmd is missing then we are probarly in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
-include/linux/autoconf.h: .kconfig.d .config
- $(Q)mkdir -p include/linux
+include/config/auto.conf: .config include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+
else
# Dummy target needed, because used as prerequisite
-include/linux/autoconf.h: ;
+include/config/auto.conf: ;
endif
# The all: target is the default when no target is given on the
@@ -781,7 +776,7 @@ PHONY += prepare-all
prepare3: .kernelrelease
ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config ]; then \
+ $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
echo " $(srctree) is not clean, please run 'make mrproper'";\
echo " in the '$(srctree)' directory.";\
/bin/false; \
@@ -824,7 +819,7 @@ include/asm:
# Split autoconf.h into include/linux/config/*
-include/config/MARKER: scripts/basic/split-include include/linux/autoconf.h
+include/config/MARKER: scripts/basic/split-include include/config/auto.conf
@echo ' SPLIT include/linux/autoconf.h -> include/config/*'
@scripts/basic/split-include include/linux/autoconf.h include/config
@touch $@
Index: linux-2.6-git/scripts/Makefile.build
===================================================================
--- linux-2.6-git.orig/scripts/Makefile.build
+++ linux-2.6-git/scripts/Makefile.build
@@ -8,7 +8,7 @@ PHONY := __build
__build:
# Read .config if it exist, otherwise ignore
--include .config
+-include include/config/auto.conf
include scripts/Kbuild.include
Index: linux-2.6-git/scripts/Makefile.modpost
===================================================================
--- linux-2.6-git.orig/scripts/Makefile.modpost
+++ linux-2.6-git/scripts/Makefile.modpost
@@ -35,7 +35,7 @@
PHONY := _modpost
_modpost: __modpost
-include .config
+include include/config/auto.conf
include scripts/Kbuild.include
include scripts/Makefile.lib
Index: linux-2.6-git/scripts/kconfig/conf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/conf.c
+++ linux-2.6-git/scripts/kconfig/conf.c
@@ -598,7 +598,15 @@ int main(int ac, char **av)
input_mode = ask_silent;
valid_stdin = 1;
}
- }
+ } else if (sym_change_count) {
+ name = getenv("KCONFIG_NOSILENTUPDATE");
+ if (name && *name) {
+ fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n"));
+ return 1;
+ }
+ } else
+ goto skip_check;
+
do {
conf_cnt = 0;
check_conf(&rootmenu);
@@ -607,5 +615,11 @@ int main(int ac, char **av)
fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
return 1;
}
+skip_check:
+ if (input_mode == ask_silent && conf_write_autoconf()) {
+ fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
+ return 1;
+ }
+
return 0;
}
Index: linux-2.6-git/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/confdata.c
+++ linux-2.6-git/scripts/kconfig/confdata.c
@@ -339,7 +339,7 @@ int conf_read(const char *name)
int conf_write(const char *name)
{
- FILE *out, *out_h;
+ FILE *out;
struct symbol *sym;
struct menu *menu;
const char *basename;
@@ -376,13 +376,6 @@ int conf_write(const char *name)
out = fopen(newname, "w");
if (!out)
return 1;
- out_h = NULL;
- if (!name) {
- out_h = fopen(".tmpconfig.h", "w");
- if (!out_h)
- return 1;
- file_write_dep(NULL);
- }
sym = sym_lookup("KERNELVERSION", 0);
sym_calc_value(sym);
time(&now);
@@ -398,16 +391,6 @@ int conf_write(const char *name)
sym_get_string_value(sym),
use_timestamp ? "# " : "",
use_timestamp ? ctime(&now) : "");
- if (out_h)
- fprintf(out_h, "/*\n"
- " * Automatically generated C config: don't edit\n"
- " * Linux kernel version: %s\n"
- "%s%s"
- " */\n"
- "#define AUTOCONF_INCLUDED\n",
- sym_get_string_value(sym),
- use_timestamp ? " * " : "",
- use_timestamp ? ctime(&now) : "");
if (!sym_change_count)
sym_clear_all_valid();
@@ -423,11 +406,6 @@ int conf_write(const char *name)
"#\n"
"# %s\n"
"#\n", str);
- if (out_h)
- fprintf(out_h, "\n"
- "/*\n"
- " * %s\n"
- " */\n", str);
} else if (!(sym->flags & SYMBOL_CHOICE)) {
sym_calc_value(sym);
if (!(sym->flags & SYMBOL_WRITE))
@@ -445,59 +423,39 @@ int conf_write(const char *name)
switch (sym_get_tristate_value(sym)) {
case no:
fprintf(out, "# CONFIG_%s is not set\n", sym->name);
- if (out_h)
- fprintf(out_h, "#undef CONFIG_%s\n", sym->name);
break;
case mod:
fprintf(out, "CONFIG_%s=m\n", sym->name);
- if (out_h)
- fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
break;
case yes:
fprintf(out, "CONFIG_%s=y\n", sym->name);
- if (out_h)
- fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
break;
}
break;
case S_STRING:
- // fix me
str = sym_get_string_value(sym);
fprintf(out, "CONFIG_%s=\"", sym->name);
- if (out_h)
- fprintf(out_h, "#define CONFIG_%s \"", sym->name);
- do {
+ while (1) {
l = strcspn(str, "\"\\");
if (l) {
fwrite(str, l, 1, out);
- if (out_h)
- fwrite(str, l, 1, out_h);
- }
- str += l;
- while (*str == '\\' || *str == '"') {
- fprintf(out, "\\%c", *str);
- if (out_h)
- fprintf(out_h, "\\%c", *str);
- str++;
+ str += l;
}
- } while (*str);
+ if (!*str)
+ break;
+ fprintf(out, "\\%c", *str++);
+ }
fputs("\"\n", out);
- if (out_h)
- fputs("\"\n", out_h);
break;
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
- if (out_h)
- fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
break;
}
case S_INT:
str = sym_get_string_value(sym);
fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
- if (out_h)
- fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
break;
}
}
@@ -517,10 +475,6 @@ int conf_write(const char *name)
}
}
fclose(out);
- if (out_h) {
- fclose(out_h);
- rename(".tmpconfig.h", "include/linux/autoconf.h");
- }
if (!name || basename != conf_def_filename) {
if (!name)
name = conf_def_filename;
@@ -539,3 +493,120 @@ int conf_write(const char *name)
return 0;
}
+
+int conf_write_autoconf(void)
+{
+ struct symbol *sym;
+ const char *str;
+ char *name;
+ FILE *out, *out_h;
+ time_t now;
+ int i, l;
+
+ file_write_dep("include/config/auto.conf.cmd");
+
+ out = fopen(".tmpconfig", "w");
+ if (!out)
+ return 1;
+
+ out_h = fopen(".tmpconfig.h", "w");
+ if (!out_h) {
+ fclose(out);
+ return 1;
+ }
+
+ sym = sym_lookup("KERNELVERSION", 0);
+ sym_calc_value(sym);
+ time(&now);
+ fprintf(out, "#\n"
+ "# Automatically generated make config: don't edit\n"
+ "# Linux kernel version: %s\n"
+ "# %s"
+ "#\n",
+ sym_get_string_value(sym), ctime(&now));
+ fprintf(out_h, "/*\n"
+ " * Automatically generated C config: don't edit\n"
+ " * Linux kernel version: %s\n"
+ " * %s"
+ " */\n"
+ "#define AUTOCONF_INCLUDED\n",
+ sym_get_string_value(sym), ctime(&now));
+
+ sym_clear_all_valid();
+
+ for_all_symbols(i, sym) {
+ sym_calc_value(sym);
+ if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
+ continue;
+ switch (sym->type) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+ break;
+ case mod:
+ fprintf(out, "CONFIG_%s=m\n", sym->name);
+ fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name);
+ break;
+ case yes:
+ fprintf(out, "CONFIG_%s=y\n", sym->name);
+ fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
+ break;
+ }
+ break;
+ case S_STRING:
+ str = sym_get_string_value(sym);
+ fprintf(out, "CONFIG_%s=\"", sym->name);
+ fprintf(out_h, "#define CONFIG_%s \"", sym->name);
+ while (1) {
+ l = strcspn(str, "\"\\");
+ if (l) {
+ fwrite(str, l, 1, out);
+ fwrite(str, l, 1, out_h);
+ str += l;
+ }
+ if (!*str)
+ break;
+ fprintf(out, "\\%c", *str);
+ fprintf(out_h, "\\%c", *str);
+ str++;
+ }
+ fputs("\"\n", out);
+ fputs("\"\n", out_h);
+ break;
+ case S_HEX:
+ str = sym_get_string_value(sym);
+ if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
+ fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
+ break;
+ }
+ case S_INT:
+ str = sym_get_string_value(sym);
+ fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
+ break;
+ default:
+ break;
+ }
+ }
+ fclose(out);
+ fclose(out_h);
+
+ name = getenv("KCONFIG_AUTOHEADER");
+ if (!name)
+ name = "include/linux/autoconf.h";
+ if (rename(".tmpconfig.h", name))
+ return 1;
+ name = getenv("KCONFIG_AUTOCONFIG");
+ if (!name)
+ name = "include/config/auto.conf";
+ /*
+ * This must be the last step, kbuild has a dependency on auto.conf
+ * and this marks the successful completion of the previous steps.
+ */
+ if (rename(".tmpconfig", name))
+ return 1;
+
+ return 0;
+}
Index: linux-2.6-git/scripts/kconfig/lkc_proto.h
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/lkc_proto.h
+++ linux-2.6-git/scripts/kconfig/lkc_proto.h
@@ -4,6 +4,7 @@ P(conf_parse,void,(const char *name));
P(conf_read,int,(const char *name));
P(conf_read_simple,int,(const char *name));
P(conf_write,int,(const char *name));
+P(conf_write_autoconf,int,(void));
/* menu.c */
P(rootmenu,struct menu,);
Index: linux-2.6-git/scripts/kconfig/util.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/util.c
+++ linux-2.6-git/scripts/kconfig/util.c
@@ -44,7 +44,9 @@ int file_write_dep(const char *name)
else
fprintf(out, "\t%s\n", file->name);
}
- fprintf(out, "\n.config include/linux/autoconf.h: $(deps_config)\n\n$(deps_config):\n");
+ fprintf(out, "\ninclude/config/auto.conf: \\\n"
+ "\t$(deps_config)\n\n"
+ "$(deps_config): ;\n");
fclose(out);
rename("..config.tmp", name);
return 0;
^ permalink raw reply
* [PATCH 7/19] kconfig: remove SYMBOL_{YES,MOD,NO}
From: Roman Zippel @ 2006-04-09 15:28 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
The SYMBOL_{YES,MOD,NO} are not really used anymore (they were more used
be the cml1 converter), so just remove them.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/expr.c | 3 ++-
scripts/kconfig/expr.h | 5 +----
scripts/kconfig/gconf.c | 6 ------
scripts/kconfig/symbol.c | 6 +++---
4 files changed, 6 insertions(+), 14 deletions(-)
Index: linux-2.6-git/scripts/kconfig/expr.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/expr.c
+++ linux-2.6-git/scripts/kconfig/expr.c
@@ -145,7 +145,8 @@ static void __expr_eliminate_eq(enum exp
return;
}
if (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
- e1->left.sym == e2->left.sym && (e1->left.sym->flags & (SYMBOL_YES|SYMBOL_NO)))
+ e1->left.sym == e2->left.sym &&
+ (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no))
return;
if (!expr_eq(e1, e2))
return;
Index: linux-2.6-git/scripts/kconfig/expr.h
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/expr.h
+++ linux-2.6-git/scripts/kconfig/expr.h
@@ -78,10 +78,7 @@ struct symbol {
#define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
-#define SYMBOL_YES 0x0001
-#define SYMBOL_MOD 0x0002
-#define SYMBOL_NO 0x0004
-#define SYMBOL_CONST 0x0007
+#define SYMBOL_CONST 0x0001
#define SYMBOL_CHECK 0x0008
#define SYMBOL_CHOICE 0x0010
#define SYMBOL_CHOICEVAL 0x0020
Index: linux-2.6-git/scripts/kconfig/gconf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/gconf.c
+++ linux-2.6-git/scripts/kconfig/gconf.c
@@ -114,12 +114,6 @@ const char *dbg_print_flags(int val)
bzero(buf, 256);
- if (val & SYMBOL_YES)
- strcat(buf, "yes/");
- if (val & SYMBOL_MOD)
- strcat(buf, "mod/");
- if (val & SYMBOL_NO)
- strcat(buf, "no/");
if (val & SYMBOL_CONST)
strcat(buf, "const/");
if (val & SYMBOL_CHECK)
Index: linux-2.6-git/scripts/kconfig/symbol.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/symbol.c
+++ linux-2.6-git/scripts/kconfig/symbol.c
@@ -15,15 +15,15 @@
struct symbol symbol_yes = {
.name = "y",
.curr = { "y", yes },
- .flags = SYMBOL_YES|SYMBOL_VALID,
+ .flags = SYMBOL_CONST|SYMBOL_VALID,
}, symbol_mod = {
.name = "m",
.curr = { "m", mod },
- .flags = SYMBOL_MOD|SYMBOL_VALID,
+ .flags = SYMBOL_CONST|SYMBOL_VALID,
}, symbol_no = {
.name = "n",
.curr = { "n", no },
- .flags = SYMBOL_NO|SYMBOL_VALID,
+ .flags = SYMBOL_CONST|SYMBOL_VALID,
}, symbol_empty = {
.name = "",
.curr = { "", no },
^ permalink raw reply
* [PATCH 9/19] kconfig: allow loading multiple configurations
From: Roman Zippel @ 2006-04-09 15:28 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Extend conf_read_simple() so it can load multiple configurations.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
scripts/kconfig/conf.c | 6 +-
scripts/kconfig/confdata.c | 111 ++++++++++++++++++++++++++------------------
scripts/kconfig/expr.h | 6 +-
scripts/kconfig/gconf.c | 6 --
scripts/kconfig/lkc.h | 2
scripts/kconfig/lkc_proto.h | 2
scripts/kconfig/symbol.c | 13 ++---
7 files changed, 84 insertions(+), 62 deletions(-)
Index: linux-2.6-git/scripts/kconfig/conf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/conf.c
+++ linux-2.6-git/scripts/kconfig/conf.c
@@ -572,7 +572,7 @@ int main(int ac, char **av)
case set_random:
name = getenv("KCONFIG_ALLCONFIG");
if (name && !stat(name, &tmpstat)) {
- conf_read_simple(name);
+ conf_read_simple(name, S_DEF_USER);
break;
}
switch (input_mode) {
@@ -583,9 +583,9 @@ int main(int ac, char **av)
default: break;
}
if (!stat(name, &tmpstat))
- conf_read_simple(name);
+ conf_read_simple(name, S_DEF_USER);
else if (!stat("all.config", &tmpstat))
- conf_read_simple("all.config");
+ conf_read_simple("all.config", S_DEF_USER);
break;
default:
break;
Index: linux-2.6-git/scripts/kconfig/confdata.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/confdata.c
+++ linux-2.6-git/scripts/kconfig/confdata.c
@@ -86,13 +86,13 @@ char *conf_get_default_confname(void)
return name;
}
-int conf_read_simple(const char *name)
+int conf_read_simple(const char *name, int def)
{
FILE *in = NULL;
char line[1024];
char *p, *p2;
struct symbol *sym;
- int i;
+ int i, def_flags;
if (name) {
in = zconf_fopen(name);
@@ -125,20 +125,21 @@ load:
conf_warnings = 0;
conf_unsaved = 0;
+ def_flags = SYMBOL_DEF << def;
for_all_symbols(i, sym) {
- sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
+ sym->flags |= SYMBOL_CHANGED;
+ sym->flags &= ~(def_flags|SYMBOL_VALID);
if (sym_is_choice(sym))
- sym->flags &= ~SYMBOL_NEW;
- sym->flags &= ~SYMBOL_VALID;
+ sym->flags |= def_flags;
switch (sym->type) {
case S_INT:
case S_HEX:
case S_STRING:
- if (sym->def[S_DEF_USER].val)
- free(sym->def[S_DEF_USER].val);
+ if (sym->def[def].val)
+ free(sym->def[def].val);
default:
- sym->def[S_DEF_USER].val = NULL;
- sym->def[S_DEF_USER].tri = no;
+ sym->def[def].val = NULL;
+ sym->def[def].tri = no;
}
}
@@ -155,19 +156,26 @@ load:
*p++ = 0;
if (strncmp(p, "is not set", 10))
continue;
- sym = sym_find(line + 9);
- if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line + 9);
- break;
- } else if (!(sym->flags & SYMBOL_NEW)) {
+ if (def == S_DEF_USER) {
+ sym = sym_find(line + 9);
+ if (!sym) {
+ conf_warning("trying to assign nonexistent symbol %s", line + 9);
+ break;
+ }
+ } else {
+ sym = sym_lookup(line + 9, 0);
+ if (sym->type == S_UNKNOWN)
+ sym->type = S_BOOLEAN;
+ }
+ if (sym->flags & def_flags) {
conf_warning("trying to reassign symbol %s", sym->name);
break;
}
switch (sym->type) {
case S_BOOLEAN:
case S_TRISTATE:
- sym->def[S_DEF_USER].tri = no;
- sym->flags &= ~SYMBOL_NEW;
+ sym->def[def].tri = no;
+ sym->flags |= def_flags;
break;
default:
;
@@ -185,34 +193,48 @@ load:
p2 = strchr(p, '\n');
if (p2)
*p2 = 0;
- sym = sym_find(line + 7);
- if (!sym) {
- conf_warning("trying to assign nonexistent symbol %s", line + 7);
- break;
- } else if (!(sym->flags & SYMBOL_NEW)) {
+ if (def == S_DEF_USER) {
+ sym = sym_find(line + 7);
+ if (!sym) {
+ conf_warning("trying to assign nonexistent symbol %s", line + 7);
+ break;
+ }
+ } else {
+ sym = sym_lookup(line + 7, 0);
+ if (sym->type == S_UNKNOWN)
+ sym->type = S_OTHER;
+ }
+ if (sym->flags & def_flags) {
conf_warning("trying to reassign symbol %s", sym->name);
break;
}
switch (sym->type) {
case S_TRISTATE:
if (p[0] == 'm') {
- sym->def[S_DEF_USER].tri = mod;
- sym->flags &= ~SYMBOL_NEW;
+ sym->def[def].tri = mod;
+ sym->flags |= def_flags;
break;
}
case S_BOOLEAN:
if (p[0] == 'y') {
- sym->def[S_DEF_USER].tri = yes;
- sym->flags &= ~SYMBOL_NEW;
+ sym->def[def].tri = yes;
+ sym->flags |= def_flags;
break;
}
if (p[0] == 'n') {
- sym->def[S_DEF_USER].tri = no;
- sym->flags &= ~SYMBOL_NEW;
+ sym->def[def].tri = no;
+ sym->flags |= def_flags;
break;
}
conf_warning("symbol value '%s' invalid for %s", p, sym->name);
break;
+ case S_OTHER:
+ if (*p != '"') {
+ for (p2 = p; *p2 && !isspace(*p2); p2++)
+ ;
+ sym->type = S_STRING;
+ goto done;
+ }
case S_STRING:
if (*p++ != '"')
break;
@@ -229,9 +251,10 @@ load:
}
case S_INT:
case S_HEX:
+ done:
if (sym_string_valid(sym, p)) {
- sym->def[S_DEF_USER].val = strdup(p);
- sym->flags &= ~SYMBOL_NEW;
+ sym->def[def].val = strdup(p);
+ sym->flags |= def_flags;
} else {
conf_warning("symbol value '%s' invalid for %s", p, sym->name);
continue;
@@ -249,24 +272,24 @@ load:
}
if (sym && sym_is_choice_value(sym)) {
struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
- switch (sym->def[S_DEF_USER].tri) {
+ switch (sym->def[def].tri) {
case no:
break;
case mod:
- if (cs->def[S_DEF_USER].tri == yes) {
+ if (cs->def[def].tri == yes) {
conf_warning("%s creates inconsistent choice state", sym->name);
- cs->flags |= SYMBOL_NEW;
+ cs->flags &= ~def_flags;
}
break;
case yes:
- if (cs->def[S_DEF_USER].tri != no) {
+ if (cs->def[def].tri != no) {
conf_warning("%s creates inconsistent choice state", sym->name);
- cs->flags |= SYMBOL_NEW;
+ cs->flags &= ~def_flags;
} else
- cs->def[S_DEF_USER].val = sym;
+ cs->def[def].val = sym;
break;
}
- cs->def[S_DEF_USER].tri = E_OR(cs->def[S_DEF_USER].tri, sym->def[S_DEF_USER].tri);
+ cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri);
}
}
fclose(in);
@@ -281,11 +304,11 @@ int conf_read(const char *name)
struct symbol *sym;
struct property *prop;
struct expr *e;
- int i;
+ int i, flags;
sym_change_count = 0;
- if (conf_read_simple(name))
+ if (conf_read_simple(name, S_DEF_USER))
return 1;
for_all_symbols(i, sym) {
@@ -314,15 +337,13 @@ int conf_read(const char *name)
sym_ok:
if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
if (sym->visible == no)
- sym->flags |= SYMBOL_NEW;
+ sym->flags &= ~SYMBOL_DEF_USER;
switch (sym->type) {
case S_STRING:
case S_INT:
case S_HEX:
- if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val)) {
- sym->flags |= SYMBOL_NEW;
- sym->flags &= ~SYMBOL_VALID;
- }
+ if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val))
+ sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
default:
break;
}
@@ -330,9 +351,11 @@ int conf_read(const char *name)
if (!sym_is_choice(sym))
continue;
prop = sym_get_choice_prop(sym);
+ flags = sym->flags;
for (e = prop->expr; e; e = e->left.expr)
if (e->right.sym->visible != no)
- sym->flags |= e->right.sym->flags & SYMBOL_NEW;
+ flags &= e->right.sym->flags;
+ sym->flags |= flags & SYMBOL_DEF_USER;
}
sym_change_count += conf_warnings || conf_unsaved;
Index: linux-2.6-git/scripts/kconfig/expr.h
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/expr.h
+++ linux-2.6-git/scripts/kconfig/expr.h
@@ -92,10 +92,14 @@ struct symbol {
#define SYMBOL_OPTIONAL 0x0100
#define SYMBOL_WRITE 0x0200
#define SYMBOL_CHANGED 0x0400
-#define SYMBOL_NEW 0x0800
#define SYMBOL_AUTO 0x1000
#define SYMBOL_CHECKED 0x2000
#define SYMBOL_WARNED 0x8000
+#define SYMBOL_DEF 0x10000
+#define SYMBOL_DEF_USER 0x10000
+#define SYMBOL_DEF2 0x20000
+#define SYMBOL_DEF3 0x40000
+#define SYMBOL_DEF4 0x80000
#define SYMBOL_MAXLENGTH 256
#define SYMBOL_HASHSIZE 257
Index: linux-2.6-git/scripts/kconfig/gconf.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/gconf.c
+++ linux-2.6-git/scripts/kconfig/gconf.c
@@ -132,8 +132,6 @@ const char *dbg_print_flags(int val)
strcat(buf, "write/");
if (val & SYMBOL_CHANGED)
strcat(buf, "changed/");
- if (val & SYMBOL_NEW)
- strcat(buf, "new/");
if (val & SYMBOL_AUTO)
strcat(buf, "auto/");
@@ -1186,9 +1184,7 @@ static gchar **fill_row(struct menu *men
row[COL_OPTION] =
g_strdup_printf("%s %s", menu_get_prompt(menu),
- sym ? (sym->
- flags & SYMBOL_NEW ? "(NEW)" : "") :
- "");
+ sym && sym_has_value(sym) ? "(NEW)" : "");
if (show_all && !menu_is_visible(menu))
row[COL_COLOR] = g_strdup("DarkGray");
Index: linux-2.6-git/scripts/kconfig/lkc.h
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/lkc.h
+++ linux-2.6-git/scripts/kconfig/lkc.h
@@ -137,7 +137,7 @@ static inline bool sym_is_optional(struc
static inline bool sym_has_value(struct symbol *sym)
{
- return sym->flags & SYMBOL_NEW ? false : true;
+ return sym->flags & SYMBOL_DEF_USER ? true : false;
}
#ifdef __cplusplus
Index: linux-2.6-git/scripts/kconfig/lkc_proto.h
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/lkc_proto.h
+++ linux-2.6-git/scripts/kconfig/lkc_proto.h
@@ -2,7 +2,7 @@
/* confdata.c */
P(conf_parse,void,(const char *name));
P(conf_read,int,(const char *name));
-P(conf_read_simple,int,(const char *name));
+P(conf_read_simple,int,(const char *name, int));
P(conf_write,int,(const char *name));
P(conf_write_autoconf,int,(void));
Index: linux-2.6-git/scripts/kconfig/symbol.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/symbol.c
+++ linux-2.6-git/scripts/kconfig/symbol.c
@@ -426,8 +426,8 @@ bool sym_set_tristate_value(struct symbo
if (oldval != val && !sym_tristate_within_range(sym, val))
return false;
- if (sym->flags & SYMBOL_NEW) {
- sym->flags &= ~SYMBOL_NEW;
+ if (!(sym->flags & SYMBOL_DEF_USER)) {
+ sym->flags |= SYMBOL_DEF_USER;
sym_set_changed(sym);
}
/*
@@ -440,11 +440,11 @@ bool sym_set_tristate_value(struct symbo
struct expr *e;
cs->def[S_DEF_USER].val = sym;
- cs->flags &= ~SYMBOL_NEW;
+ cs->flags |= SYMBOL_DEF_USER;
prop = sym_get_choice_prop(cs);
for (e = prop->expr; e; e = e->left.expr) {
if (e->right.sym->visible != no)
- e->right.sym->flags &= ~SYMBOL_NEW;
+ e->right.sym->flags |= SYMBOL_DEF_USER;
}
}
@@ -591,8 +591,8 @@ bool sym_set_string_value(struct symbol
if (!sym_string_within_range(sym, newval))
return false;
- if (sym->flags & SYMBOL_NEW) {
- sym->flags &= ~SYMBOL_NEW;
+ if (!(sym->flags & SYMBOL_DEF_USER)) {
+ sym->flags |= SYMBOL_DEF_USER;
sym_set_changed(sym);
}
@@ -679,7 +679,6 @@ struct symbol *sym_lookup(const char *na
memset(symbol, 0, sizeof(*symbol));
symbol->name = new_name;
symbol->type = S_UNKNOWN;
- symbol->flags = SYMBOL_NEW;
if (isconst)
symbol->flags |= SYMBOL_CONST;
^ 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.