]> rtime.felk.cvut.cz Git - l4.git/commitdiff
update
authorl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Sun, 8 Aug 2010 10:17:02 +0000 (10:17 +0000)
committerl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Sun, 8 Aug 2010 10:17:02 +0000 (10:17 +0000)
git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@16 d050ee49-bd90-4346-b210-929a50b99cfc

58 files changed:
kernel/fiasco/src/Modules.amd64
kernel/fiasco/src/Modules.arm
kernel/fiasco/src/Modules.ia32
kernel/fiasco/src/Modules.ppc32
kernel/fiasco/src/Modules.ux
kernel/fiasco/src/jdb/jdb_ipc_gate.cpp
kernel/fiasco/src/kern/context-vcpu.cpp
kernel/fiasco/src/kern/ia32/cpu-ia32.cpp
kernel/fiasco/src/kern/ia32/kernel_thread-ia32.cpp
kernel/fiasco/src/kern/ia32/vm.cpp
kernel/fiasco/src/kern/ia32/vm_svm.cpp
kernel/fiasco/src/kern/ppc32/kip_init.cpp
kernel/fiasco/src/kern/ppc32/timer-decr-ppc32.cpp
kernel/fiasco/src/kern/thread-vcpu.cpp
kernel/fiasco/tool/kconfig/Makefile
kernel/fiasco/tool/kconfig/README
kernel/fiasco/tool/kconfig/scripts/Makefile.build
kernel/fiasco/tool/kconfig/scripts/Makefile.lib
kernel/fiasco/tool/kconfig/scripts/kconfig/Makefile
kernel/fiasco/tool/kconfig/scripts/kconfig/expr.c
kernel/fiasco/tool/kconfig/scripts/kconfig/expr.h
kernel/fiasco/tool/kconfig/scripts/kconfig/gconf.c
kernel/fiasco/tool/kconfig/scripts/kconfig/gconf.glade
kernel/fiasco/tool/kconfig/scripts/kconfig/lkc.h
kernel/fiasco/tool/kconfig/scripts/kconfig/lkc_proto.h
kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/inputbox.c
kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/menubox.c
kernel/fiasco/tool/kconfig/scripts/kconfig/mconf.c
kernel/fiasco/tool/kconfig/scripts/kconfig/menu.c
kernel/fiasco/tool/kconfig/scripts/kconfig/symbol.c
kernel/fiasco/tool/kconfig/scripts/kconfig/util.c
kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped
kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.y
l4/mk/config.inc
l4/pkg/ankh/server/netlib/linux_glue.c
l4/pkg/ankh/server/netlib/ux.c
l4/pkg/bootstrap/server/src/startup.cc
l4/pkg/dope/server/l4/server.cc
l4/pkg/ned/server/src/lua.cc
l4/tool/kconfig/Makefile
l4/tool/kconfig/README
l4/tool/kconfig/scripts/Makefile.build
l4/tool/kconfig/scripts/Makefile.lib
l4/tool/kconfig/scripts/kconfig/Makefile
l4/tool/kconfig/scripts/kconfig/expr.c
l4/tool/kconfig/scripts/kconfig/expr.h
l4/tool/kconfig/scripts/kconfig/gconf.c
l4/tool/kconfig/scripts/kconfig/gconf.glade
l4/tool/kconfig/scripts/kconfig/lkc.h
l4/tool/kconfig/scripts/kconfig/lkc_proto.h
l4/tool/kconfig/scripts/kconfig/lxdialog/inputbox.c
l4/tool/kconfig/scripts/kconfig/lxdialog/menubox.c
l4/tool/kconfig/scripts/kconfig/mconf.c
l4/tool/kconfig/scripts/kconfig/menu.c
l4/tool/kconfig/scripts/kconfig/symbol.c
l4/tool/kconfig/scripts/kconfig/util.c
l4/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped
l4/tool/kconfig/scripts/kconfig/zconf.y

index 0f325cc073186654157134d25e2bb19f35ce5858..063a959c6d2029470af868ca598567ebd76cd461 100644 (file)
@@ -50,7 +50,7 @@ VPATH                 += abi/$(CONFIG_XARCH) abi
 INTERFACES_ABI         := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
                           l4_error virt
 
-kip_IMPL               := kip kip-amd64 kip-debug kip-amd64-debug
+kip_IMPL               := kip kip-debug kip-amd64 kip-amd64-debug
 l4_types_IMPL          := l4_types l4_types-debug
 virt_IMPL              := virt-ia32-amd64
 
@@ -86,8 +86,8 @@ processor_IMPL                := processor processor-amd64
 # KERNEL subsystem
 #
 KERNEL                 := fiasco.image
-VPATH                  += kern/$(CONFIG_XARCH) kern/shared kern/ia32/64 kern/ia32 kern
-PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/shared kern/ia32/64 kern/ia32 kern 
+VPATH                  += kern/$(CONFIG_XARCH) kern/ia32/64 kern/ia32 kern
+PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/ia32/64 kern/ia32 kern
 
 INTERFACES_KERNEL      := cpu_mask rcupdate pages kobject_mapdb \
                           mem_region per_cpu_data startup boot_info cmdline \
@@ -167,7 +167,7 @@ startup_IMPL                := startup startup-ia32
 task_IMPL              := task task-ia32-amd64
 tb_entry_IMPL          := tb_entry tb_entry-ia32-64
 timer_IMPL             := timer timer-ia32-amd64-ux
-thread_IMPL            := thread thread-ia32-64 thread-ia32 \
+thread_IMPL            := thread thread-ia32 thread-ia32-64 \
                           thread-ipc \
                           thread-list \
                           thread-pagefault thread-log      \
@@ -241,7 +241,7 @@ jdb_kern_info_IMPL  := jdb_kern_info jdb_kern_info-ia32-amd64 \
                           jdb_kern_info-ia32-ux jdb_kern_info-apic \
                           jdb_kern_info-pci jdb_kern_info-bench \
                           jdb_kern_info-bench-ia32-64 \
-                          jdb_kern_info-dr
+                          jdb_kern_info-dr jdb_kern_info-mtrr
 jdb_misc_IMPL          := jdb_misc-ia32-amd64
 jdb_ptab_IMPL          := jdb_ptab jdb_ptab-amd64
 jdb_screen_IMPL                := jdb_screen jdb_screen-ia32
index a441cf36cbe500468e97b7f8f2e7de05fb2ade8c..9797a3a94ed69dcec797afada067c27813243634 100644 (file)
@@ -148,9 +148,9 @@ kip_IMPL    := kip kip-debug kip-arm
 #
 KERNEL                 := fiasco
 KERNEL_EXTRA   := Symbols
-VPATH          += kern/$(CONFIG_XARCH) kern kern/shared
+VPATH          += kern/$(CONFIG_XARCH) kern
 VPATH          += jdb/arm jdb
-PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern kern/shared
+PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern
 
 INTERFACES_KERNEL :=   kmem boot_info pages __main globals config \
                        main cache kobject_mapdb dbg_page_info \
index d0c8129e622403063d98ac4b1476e4b90f3817df..b34209f7def03ecd65345db619fe312c51556801 100644 (file)
@@ -29,13 +29,13 @@ PREPROCESS_PARTS-$(CONFIG_SCHED_HPET)        += hpet_timer
 PREPROCESS_PARTS-$(CONFIG_SERIAL)            += serial 16550
 PREPROCESS_PARTS-$(CONFIG_WATCHDOG)          += watchdog
 PREPROCESS_PARTS-$(CONFIG_PERF_CNT)          += perf_cnt
-PREPROCESS_PARTS-$(CONFIG_HANDLE_SEGMENTS)   += segments
 PREPROCESS_PARTS-$(CONFIG_IO_PROT)           += io
-PREPROCESS_PARTS-$(CONFIG_IO_PROT_IOPL_3)    += iopl3
 PREPROCESS_PARTS-$(CONFIG_CPU_VIRT)          += svm
 PREPROCESS_PARTS-$(CONFIG_SCHED_FIXED_PRIO)  += sched_fixed_prio
 PREPROCESS_PARTS-$(CONFIG_SCHED_WFQ)         += sched_wfq
 PREPROCESS_PARTS-$(CONFIG_SCHED_FP_WFQ)      += sched_fp_wfq
+PREPROCESS_PARTS-$(CONFIG_HANDLE_SEGMENTS)   += segments
+PREPROCESS_PARTS-$(CONFIG_IO_PROT_IOPL_3)    += iopl3
 
 PREPROCESS_PARTS        += $(PREPROCESS_PARTS-y)
 
@@ -52,7 +52,7 @@ VPATH                 += abi/$(CONFIG_XARCH) abi
 INTERFACES_ABI         := l4_fpage l4_msg_item l4_buf_desc kip l4_types \
                           l4_error virt
 
-kip_IMPL               := kip kip-ia32 kip-debug kip-ia32-debug
+kip_IMPL               := kip kip-debug kip-ia32 kip-ia32-debug
 l4_types_IMPL          := l4_types l4_types-debug
 virt_IMPL              := virt-ia32-amd64
 
@@ -88,8 +88,8 @@ processor_IMPL                := processor processor-ia32
 # KERNEL subsystem
 #
 KERNEL                 := fiasco.image
-VPATH                  += kern/$(CONFIG_XARCH) kern/shared kern/ia32/32 kren/ia32 kern
-PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/shared kern/ia32/32 kern/ia32 kern 
+VPATH                  += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
+PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
 
 INTERFACES_KERNEL      := cpu_mask rcupdate pages kobject_mapdb \
                           mem_region per_cpu_data startup boot_info cmdline \
@@ -151,7 +151,7 @@ kmem_alloc_IMPL             := kmem_alloc kmem_alloc-ia32
 main_IMPL              := main-ia32-32 main-ia32
 mapping_IMPL           := mapping-ia32-32 mapping
 map_util_IMPL          := map_util map_util-mem map_util-io map_util-objs
-mem_layout_IMPL                := mem_layout mem_layout-ia32-32 mem_layout-ia32
+mem_layout_IMPL                := mem_layout mem_layout-ia32 mem_layout-ia32-32
 mem_space_IMPL         := mem_space mem_space-user mem_space-ia32
 mem_unit_IMPL          := mem_unit-ia32
 obj_space_IMPL          := obj_space obj_space-$(OBJ_SPACE)
index 0c4ad43952a3c5ef5e01bed8e25531c614a52098..83487804a7abfa18e514635e783efa700309fec4 100644 (file)
@@ -89,9 +89,9 @@ CSRC_LIBAMM   := amm_alloc_entry.c amm_allocate.c amm_deallocate.c amm_destroy.c \
 #
 # JABI Subsystem
 #
-JABI                   := libjabi.a
-VPATH                  += jabi/$(CONFIG_XARCH) jabi
-INTERFACES_JABI                := jdb_ktrace
+JABI           := libjabi.a
+VPATH          += jabi/$(CONFIG_XARCH) jabi
+INTERFACES_JABI        := jdb_ktrace
 
 
 #
@@ -99,23 +99,19 @@ INTERFACES_JABI             := jdb_ktrace
 #
 ABI            := libabi.a
 VPATH          += abi/$(CONFIG_XARCH) abi
-#
-INTERFACES_ABI         := kip l4_types l4_fpage l4_msg_item \
-                          l4_buf_desc l4_error
-#
-l4_types_IMPL  := l4_types l4_types-debug
+INTERFACES_ABI         := kip l4_types l4_fpage l4_msg_item l4_buf_desc l4_error
 
-## x0!=32Bit UIDs
 kip_IMPL       := kip kip-debug kip-ppc32
+l4_types_IMPL  := l4_types l4_types-debug
 
 #
 # KERNEL subsystem
 #
 KERNEL                 := fiasco
 KERNEL_EXTRA   := Symbols
-VPATH          += kern/$(CONFIG_XARCH) kern kern/shared
+VPATH          += kern/$(CONFIG_XARCH) kern
 VPATH          += jdb/$(CONFIG_XARCH) jdb
-PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern kern/shared kern/ia32
+PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern kern/ia32
 
 INTERFACES_KERNEL :=   banner bitmap boot_info boot_uart_init bootstrap       \
                        buddy_alloc cmdline config context cpu scheduler      \
index d463f2e63a3d167bfb0f720cfe0cc42bb40aee11..eb4d189eb949e07c5bf2839fcf747327bb09a8c5 100644 (file)
@@ -64,17 +64,13 @@ mem_IMPL            := mem mem-ia32
 #
 KERNEL                 := fiasco.image
 KERNEL_EXTRA           := irq0
-VPATH                  += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern/shared kern
+VPATH                  += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
 VPATH                  += jdb/ia32 jdb/ia32/32 jdb/ux jdb
-PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern/shared kern
+PRIVATE_INCDIR         += kern/$(CONFIG_XARCH) kern/ia32/32 kern/ia32 kern
 
-ifeq ("$(CONFIG_UX_CON)","y")
-  KERNEL_EXTRA         += ux_con
-endif
-
-ifeq ("$(CONFIG_UX_NET)","y")
-  KERNEL_EXTRA         += ux_net
-endif
+KERNEL_EXTRA-$(CONFIG_UX_CON)) += ux_con
+KERNEL_EXTRA-$(CONFIG_UX_NET)  += ux_net
+KERNEL_EXTRA            += $(KERNEL_EXTRA-y)
 
 # KERNEL modules.  
 
index 4553fbfd54d1f22e34db39cb33d05d2f20523016..f9806cb4bf0416ebe6f092242f258f0115ddddc8 100644 (file)
@@ -31,7 +31,7 @@ Kobject *
 Jdb_ipc_gate::follow_link(Kobject *o)
 {
   Ipc_gate_obj *g = Kobject::dcast<Ipc_gate_obj *>(o);
-  return static_cast<Kobject*>(g->thread());
+  return g->thread() ? static_cast<Kobject*>(g->thread()) : o;
 }
 
 PUBLIC
index 1a3c5e7ae089c6a1da1ac6d1c1cdadfe206f905a..c322bc9f31da59cb9a3cead6f35a223ebf13cd77 100644 (file)
@@ -61,14 +61,15 @@ Context::vcpu_enter_kernel_mode()
   if (EXPECT_FALSE(state() & Thread_vcpu_enabled))
     {
       vcpu_state()->_saved_state = vcpu_state()->state;
-      Mword flags =
-         Vcpu_state::F_traps
-       | Vcpu_state::F_user_mode;
+      Mword flags = Vcpu_state::F_traps
+                   | Vcpu_state::F_user_mode;
       vcpu_state()->state &= ~flags;
       if (state() & Thread_vcpu_user_mode)
        {
          vcpu_state()->_sp = vcpu_state()->_entry_sp;
-         state_del_dirty(Thread_vcpu_user_mode | Thread_vcpu_fpu_disabled);
+         state_del_dirty(  Thread_vcpu_user_mode
+                          | Thread_vcpu_fpu_disabled
+                          | Thread_alien);
 
          if (current() == this)
            {
@@ -186,8 +187,9 @@ Context::vcpu_log_fmt(Tb_entry *e, int maxlen, char *buf)
   switch (l->type)
     {
     case 0:
-      return snprintf(buf, maxlen, "ret pc=%lx sp=%lx state=%lx task=D:%lx",
-         l->ip, l->sp, l->state, l->space);
+    case 4:
+      return snprintf(buf, maxlen, "%sret pc=%lx sp=%lx state=%lx task=D:%lx",
+         l->type == 4 ? "f" : "", l->ip, l->sp, l->state, l->space);
     case 1:
       return snprintf(buf, maxlen, "ipc from D:%lx task=D:%lx sp=%lx",
          Kobject_dbg::pointer_to_id((Kobject*)l->ip), l->state, l->sp);
index 59b8a8a7f118c87a002f61015b4919772a2ef4bc..07d468d053bd9c95799cdd873eb03439bb030b37 100644 (file)
@@ -845,6 +845,19 @@ Cpu::addr_size_info()
   _virt_bits = (eax & 0xff00) >> 8;
 }
 
+PUBLIC static
+unsigned
+Cpu::amd_cpuid_mnc()
+{
+  Unsigned32 eax, ebx, ecx, edx;
+  cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
+
+  unsigned apicidcoreidsize = (ecx >> 12) & 0xf;
+  if (apicidcoreidsize == 0)
+    return (ecx & 0xf) + 1; // NC
+  return 1 << apicidcoreidsize;
+}
+
 PRIVATE FIASCO_INIT_CPU
 void
 Cpu::set_model_str()
@@ -1519,9 +1532,9 @@ PUBLIC
 void
 Cpu::print() const
 {
-  printf ("CPU[%u:%u]: %s (%X:%X:%X:%X) Model: %s at %llu MHz\n\n",
+  printf ("CPU[%u:%u]: %s (%X:%X:%X:%X)[%08x] Model: %s at %llu MHz\n\n",
           id(), phys_id() >> 24,
-          vendor_str(), family(), model(), stepping(), brand(), model_str(),
+          vendor_str(), family(), model(), stepping(), brand(), _version, model_str(),
           div32(frequency(), 1000000));
 }
 
index f17b89d57ef83bf470555f34ad660b0afda9a7b3..b7d89c14cf5c0c55ffca1e8b7d6f229c7ba0d95d 100644 (file)
@@ -111,6 +111,11 @@ IMPLEMENTATION [mp]:
 static void
 Kernel_thread::boot_app_cpus()
 {
+  // sending (INIT-)IPIs on non-MP systems might not work
+  if (   Cpu::boot_cpu()->vendor() == Cpu::Vendor_amd
+      && Cpu::amd_cpuid_mnc() < 2)
+    return;
+
   // where to start the APs for detection of the APIC-IDs
   extern char _tramp_mp_entry[];
 
@@ -144,5 +149,4 @@ Kernel_thread::boot_app_cpus()
 
   // Send IPI-Sequency to startup the APs
   Apic::mp_startup(Cpu::boot_cpu(), Apic::APIC_IPI_OTHERS, tramp_page);
-
 }
index c08b0895066a101064693ceb581e456686e9f001..93592e708fcb5f8d728395e46135c66d9764bc6c 100644 (file)
@@ -47,7 +47,6 @@ Vm::Vm(Ram_quota *q)
 {
 }
 
-
 PUBLIC static
 template< typename VM >
 slab_cache_anon *
@@ -81,3 +80,20 @@ Vm::vm_invoke(L4_obj_ref obj, Mword rights, Syscall_frame *f, Utcb *utcb)
       return;
     }
 }
+
+
+// ------------------------------------------------------------------------
+IMPLEMENTATION [ia32]:
+
+PROTECTED static inline
+bool
+Vm::is_64bit()
+{ return false; }
+
+// ------------------------------------------------------------------------
+IMPLEMENTATION [amd64]:
+
+PROTECTED static inline
+bool
+Vm::is_64bit()
+{ return true; }
index f8273a94d9f33e89e17c30e1290dc886fd8266a4..0b96d0546ae35d0c4ffec220c59b9808bd7ae083 100644 (file)
@@ -51,11 +51,6 @@ IMPLEMENTATION [svm && ia32]:
 
 #include "virt.h"
 
-PRIVATE static inline
-bool
-Vm_svm::is_64bit()
-{ return false; }
-
 PRIVATE inline NEEDS["virt.h"]
 Address
 Vm_svm::get_vm_cr3(Vmcb *)
@@ -70,11 +65,6 @@ IMPLEMENTATION [svm && amd64]:
 
 #include "virt.h"
 
-PRIVATE static inline
-bool
-Vm_svm::is_64bit()
-{ return true; }
-
 PRIVATE inline NEEDS["virt.h"]
 Address
 Vm_svm::get_vm_cr3(Vmcb *v)
index a46ac5a45eac139ebfaff4fefe348f88e205bcaf..ab26d53556cb96a1727e00c8312db8195eb747c8 100644 (file)
@@ -51,7 +51,7 @@ namespace KIP_namespace
        /* A0 */ 0, {},
        /* B0 */ 0, 0, {},
        /* C0 */ {},
-       /* E0 */ 0, 0, {}
+       /* E0 */ 0, 0, {},
        /* F0 */ { 0, 0, 0 }, { "" },
       },
       "",
index f82ba61ee881afd71a4293ef07bad1cc9ce44384..6121b912a5b0425a34736171369bdb619ea331e9 100644 (file)
@@ -65,3 +65,8 @@ Timer::update_system_clock()
   Kip::k()->clock += Config::scheduler_granularity;
 }
 
+IMPLEMENT inline
+void
+Timer::update_timer(Unsigned64)
+{
+}
index 09f0e8b3008634ea7e877de28d61ed50982c7335..1ad498cc2ffbb6290cd1761927dc721a7fb8da5d 100644 (file)
@@ -104,6 +104,15 @@ Thread::sys_vcpu_resume(L4_msg_tag const &tag, Utcb *utcb)
          else
            sp = vcpu_state()->_ts.sp();
 
+         LOG_TRACE("VCPU events", "vcpu", this, __context_vcpu_log_fmt,
+             Vcpu_log *l = tbe->payload<Vcpu_log>();
+             l->type = 4;
+             l->state = vcpu_state()->state;
+             l->ip = vcpu_state()->_entry_ip;
+             l->sp = sp;
+             l->space = vcpu_user_space() ? static_cast<Task*>(vcpu_user_space())->dbg_id() : ~0;
+             );
+
          fast_return_to_user(vcpu_state()->_entry_ip, sp, false);
        }
     }
@@ -126,7 +135,7 @@ Thread::sys_vcpu_resume(L4_msg_tag const &tag, Utcb *utcb)
 
       vcpu_state()->state |= Vcpu_state::F_traps | Vcpu_state::F_exceptions
                              | Vcpu_state::F_debug_exc;
-      state_add_dirty(Thread_vcpu_user_mode);
+      state_add_dirty(Thread_vcpu_user_mode | Thread_alien);
 
       if (!(vcpu_state()->state & Vcpu_state::F_fpu_enabled))
        {
index d9bed0a3f1c90a33ccd2e962cab1ddde100a0e54..40e455b3d5bac6d3f7b3735a8e9f55ab660f2657 100644 (file)
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 34
+SUBLEVEL = 35
 EXTRAVERSION =
 NAME = Sheep on Meth
 
@@ -183,11 +183,14 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 # CROSS_COMPILE can be set on the command line
 # make CROSS_COMPILE=ia64-linux-
 # Alternatively CROSS_COMPILE can be set in the environment.
+# A third alternative is to store a setting in .config so that plain
+# "make" in the configured kernel build directory always uses that.
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 export KBUILD_BUILDHOST := $(SUBARCH)
 ARCH           ?= $(SUBARCH)
 CROSS_COMPILE  ?=
+CROSS_COMPILE  ?= $(CONFIG_CROSS_COMPILE:"%"=%)
 
 # Architecture as present in compile.h
 UTS_MACHINE    := $(ARCH)
@@ -576,9 +579,6 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 # disable invalid "can't wrap" optimizations for signed / pointers
 KBUILD_CFLAGS  += $(call cc-option,-fno-strict-overflow)
 
-# revert to pre-gcc-4.4 behaviour of .eh_frame
-KBUILD_CFLAGS  += $(call cc-option,-fno-dwarf2-cfi-asm)
-
 # conserve stack if available
 KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
 
@@ -882,73 +882,11 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
 PHONY += $(vmlinux-dirs)
 $(vmlinux-dirs): prepare scripts
        $(Q)$(MAKE) $(build)=$@
-ifdef CONFIG_MODULES
-       $(Q)$(MAKE) $(modbuiltin)=$@
-endif
-
-# Build the kernel release string
-#
-# The KERNELRELEASE value built here is stored in the file
-# include/config/kernel.release, and is used when executing several
-# make targets, such as "make install" or "make modules_install."
-#
-# The eventual kernel release string consists of the following fields,
-# shown in a hierarchical format to show how smaller parts are concatenated
-# to form the larger and final value, with values coming from places like
-# the Makefile, kernel config options, make command line options and/or
-# SCM tag information.
-#
-#      $(KERNELVERSION)
-#        $(VERSION)                    eg, 2
-#        $(PATCHLEVEL)                 eg, 6
-#        $(SUBLEVEL)                   eg, 18
-#        $(EXTRAVERSION)               eg, -rc6
-#      $(localver-full)
-#        $(localver)
-#          localversion*               (files without backups, containing '~')
-#          $(CONFIG_LOCALVERSION)      (from kernel config setting)
-#        $(localver-auto)              (only if CONFIG_LOCALVERSION_AUTO is set)
-#          ./scripts/setlocalversion   (SCM tag, if one exists)
-#          $(LOCALVERSION)             (from make command line if provided)
-#
-#  Note how the final $(localver-auto) string is included *only* if the
-# kernel config option CONFIG_LOCALVERSION_AUTO is selected.  Also, at the
-# moment, only git is supported but other SCMs can edit the script
-# scripts/setlocalversion and add the appropriate checks as needed.
-
-pattern = ".*/localversion[^~]*"
-string  = $(shell cat /dev/null \
-          `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`)
-
-localver = $(subst $(space),, $(string) \
-                             $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
-
-# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
-# and if the SCM is know a tag from the SCM is appended.
-# The appended tag is determined by the SCM used.
-#
-# .scmversion is used when generating rpm packages so we do not loose
-# the version information from the SCM when we do the build of the kernel
-# from the copied source
-ifdef CONFIG_LOCALVERSION_AUTO
-
-ifeq ($(wildcard .scmversion),)
-        _localver-auto = $(shell $(CONFIG_SHELL) \
-                         $(srctree)/scripts/setlocalversion $(srctree))
-else
-        _localver-auto = $(shell cat .scmversion 2> /dev/null)
-endif
-
-       localver-auto  = $(LOCALVERSION)$(_localver-auto)
-endif
-
-localver-full = $(localver)$(localver-auto)
 
 # Store (new) KERNELRELASE string in include/config/kernel.release
-kernelrelease = $(KERNELVERSION)$(localver-full)
 include/config/kernel.release: include/config/auto.conf FORCE
        $(Q)rm -f $@
-       $(Q)echo $(kernelrelease) > $@
+       $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
 
 
 # Things we need to do before we recursively start building the kernel
@@ -1087,13 +1025,18 @@ all: modules
 #      using awk while concatenating to the final file.
 
 PHONY += modules
-modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
+modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
        $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
-       $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
        @$(kecho) '  Building modules, stage 2.';
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
 
+modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+       $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
+
+%/modules.builtin: include/config/auto.conf
+       $(Q)$(MAKE) $(modbuiltin)=$*
+
 
 # Target to prepare building external modules
 PHONY += modules_prepare
@@ -1247,7 +1190,9 @@ help:
        @echo  '  firmware_install- Install all firmware to INSTALL_FW_PATH'
        @echo  '                    (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
        @echo  '  dir/            - Build all files in dir and below'
-       @echo  '  dir/file.[ois]  - Build specified target only'
+       @echo  '  dir/file.[oisS] - Build specified target only'
+       @echo  '  dir/file.lst    - Build specified mixed source/assembly target only'
+       @echo  '                    (requires a recent binutils and recent build (System.map))'
        @echo  '  dir/file.ko     - Build module including final link'
        @echo  '  modules_prepare - Set up for building external modules'
        @echo  '  tags/TAGS       - Generate tags file for editors'
index 9aa5d1f01a586b8563456d37936808a6540b77ca..1ca79add8d224fd41842afb1b211917eec0f65de 100644 (file)
@@ -1,3 +1,3 @@
 
-kconfig taken from vanilla Linux 2.6.34, and slightly patched.
+kconfig taken from vanilla Linux 2.6.35, and slightly patched.
 
index 0b94d2fa3a883ce4cf1b9bdd6219e30bc338f480..e4deb73e9a84971d46ac3dab9bd96cf8ffc8236f 100644 (file)
@@ -82,7 +82,7 @@ ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
 lib-target := $(obj)/lib.a
 endif
 
-ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),)
+ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),)
 builtin-target := $(obj)/built-in.o
 endif
 
index f9bdf264473db421f4a720eaca0d4c5456e4d7e6..54fd1b700131e1e1fcb0ddd13d89ee3a06983ecb 100644 (file)
@@ -241,7 +241,11 @@ cmd_lzma = (cat $(filter-out FORCE,$^) | \
        lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
        (rm -f $@ ; false)
 
-quiet_cmd_lzo = LZO    $@
+quiet_cmd_lzo = LZO     $@
 cmd_lzo = (cat $(filter-out FORCE,$^) | \
        lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
        (rm -f $@ ; false)
+
+# misc stuff
+# ---------------------------------------------------------------------------
+quote:="
index 186c46604d0669f8f1d4cfbcaf7ad0cdc6d658fa..7ea649da19400252ba751bfdb8bea5e7a5dba426 100644 (file)
@@ -23,6 +23,9 @@ menuconfig: $(obj)/mconf
 config: $(obj)/conf
        $< $(Kconfig)
 
+nconfig: $(obj)/nconf
+       $< $(Kconfig)
+
 oldconfig: $(obj)/conf
        $< -o $(Kconfig)
 
@@ -120,6 +123,7 @@ endif
 # Help text used by make help
 help:
        @echo  '  config          - Update current config utilising a line-oriented program'
+       @echo  '  nconfig         - Update current config utilising a ncurses menu based program'
        @echo  '  menuconfig      - Update current config utilising a menu based program'
        @echo  '  xconfig         - Update current config utilising a QT based front-end'
        @echo  '  gconfig         - Update current config utilising a GTK based front-end'
@@ -147,6 +151,8 @@ HOST_EXTRACFLAGS += -DLOCALE
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
 # conf:          Used for defconfig, oldconfig and related targets
+# nconf:  Used for the nconfig target.
+#         Utilizes ncurses
 # mconf:  Used for the menuconfig target
 #         Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
@@ -159,11 +165,16 @@ lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
 lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
 
 conf-objs      := conf.o  zconf.tab.o
-mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+nconf-objs     := nconf.o zconf.tab.o nconf.gui.o
 kxgettext-objs := kxgettext.o zconf.tab.o
 
 hostprogs-y := conf qconf gconf kxgettext
 
+ifeq ($(MAKECMDGOALS),nconfig)
+       hostprogs-y += nconf
+endif
+
 ifeq ($(MAKECMDGOALS),menuconfig)
        hostprogs-y += mconf
 endif
@@ -187,7 +198,7 @@ endif
 
 clean-files    := lkc_defs.h qconf.moc .tmp_qtcheck \
                   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
-clean-files     += mconf qconf gconf
+clean-files     += mconf qconf gconf nconf
 clean-files     += config.pot linux.pot
 
 # Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
@@ -208,10 +219,11 @@ HOSTCFLAGS_zconf.tab.o    := -I$(src)
 HOSTLOADLIBES_qconf    = $(KC_QT_LIBS) -ldl
 HOSTCXXFLAGS_qconf.o   = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
 
-HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
+HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl
 HOSTCFLAGS_gconf.o     = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
                           -D LKC_DIRECT_LINK
 
+HOSTLOADLIBES_nconf    = -lmenu -lpanel -lncurses
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
index edd3f39a080a422175bf512c94dd1d5bf87e059b..d83f2322893a8adb10f027e2c4fa4757a33e26f0 100644 (file)
@@ -1097,9 +1097,32 @@ void expr_fprint(struct expr *e, FILE *out)
 
 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str)
 {
-       str_append((struct gstr*)data, str);
+       struct gstr *gs = (struct gstr*)data;
+       const char *sym_str = NULL;
+
+       if (sym)
+               sym_str = sym_get_string_value(sym);
+
+       if (gs->max_width) {
+               unsigned extra_length = strlen(str);
+               const char *last_cr = strrchr(gs->s, '\n');
+               unsigned last_line_length;
+
+               if (sym_str)
+                       extra_length += 4 + strlen(sym_str);
+
+               if (!last_cr)
+                       last_cr = gs->s;
+
+               last_line_length = strlen(gs->s) - (last_cr - gs->s);
+
+               if ((last_line_length + extra_length) > gs->max_width)
+                       str_append(gs, "\\\n");
+       }
+
+       str_append(gs, str);
        if (sym)
-               str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym));
+               str_printf(gs, " [=%s]", sym_str);
 }
 
 void expr_gstr_print(struct expr *e, struct gstr *gs)
index 6408fefae083703e2fa3d8e8a3d4f8a814f44f0b..891cd9ce9ba21b915d0b0aa993fc2d0c8d2fb10c 100644 (file)
@@ -86,7 +86,7 @@ struct symbol {
        struct expr_value rev_dep;
 };
 
-#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 for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
 
 #define SYMBOL_CONST      0x0001  /* symbol is const */
 #define SYMBOL_CHECK      0x0008  /* used during dependency checking */
@@ -108,8 +108,7 @@ struct symbol {
 #define SYMBOL_DEF4       0x80000  /* symbol.def[S_DEF_4] is valid */
 
 #define SYMBOL_MAXLENGTH       256
-#define SYMBOL_HASHSIZE                257
-#define SYMBOL_HASHMASK                0xff
+#define SYMBOL_HASHSIZE                9973
 
 /* A property represent the config options that can be associated
  * with a config "symbol".
index bfa31639aee2d6bb9e761956bfe7dd4f54280fc4..40689d94ec735cc746c2aebc667069006f09bd88 100644 (file)
@@ -30,13 +30,16 @@ enum {
        SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW
 };
 
+enum {
+       OPT_NORMAL, OPT_ALL, OPT_PROMPT
+};
+
 static gint view_mode = FULL_VIEW;
 static gboolean show_name = TRUE;
 static gboolean show_range = TRUE;
 static gboolean show_value = TRUE;
-static gboolean show_all = FALSE;
-static gboolean show_debug = FALSE;
 static gboolean resizeable = FALSE;
+static int opt_mode = OPT_NORMAL;
 
 GtkWidget *main_wnd = NULL;
 GtkWidget *tree1_w = NULL;     // left  frame
@@ -76,36 +79,7 @@ static void conf_changed(void);
 
 /* Helping/Debugging Functions */
 
-
-const char *dbg_print_stype(int val)
-{
-       static char buf[256];
-
-       bzero(buf, 256);
-
-       if (val == S_UNKNOWN)
-               strcpy(buf, "unknown");
-       if (val == S_BOOLEAN)
-               strcpy(buf, "boolean");
-       if (val == S_TRISTATE)
-               strcpy(buf, "tristate");
-       if (val == S_INT)
-               strcpy(buf, "int");
-       if (val == S_HEX)
-               strcpy(buf, "hex");
-       if (val == S_STRING)
-               strcpy(buf, "string");
-       if (val == S_OTHER)
-               strcpy(buf, "other");
-
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
-
-       return buf;
-}
-
-const char *dbg_print_flags(int val)
+const char *dbg_sym_flags(int val)
 {
        static char buf[256];
 
@@ -131,40 +105,10 @@ const char *dbg_print_flags(int val)
                strcat(buf, "auto/");
 
        buf[strlen(buf) - 1] = '\0';
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
-
-       return buf;
-}
-
-const char *dbg_print_ptype(int val)
-{
-       static char buf[256];
-
-       bzero(buf, 256);
-
-       if (val == P_UNKNOWN)
-               strcpy(buf, "unknown");
-       if (val == P_PROMPT)
-               strcpy(buf, "prompt");
-       if (val == P_COMMENT)
-               strcpy(buf, "comment");
-       if (val == P_MENU)
-               strcpy(buf, "menu");
-       if (val == P_DEFAULT)
-               strcpy(buf, "default");
-       if (val == P_CHOICE)
-               strcpy(buf, "choice");
-
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
 
        return buf;
 }
 
-
 void replace_button_icon(GladeXML * xml, GdkDrawable * window,
                         GtkStyle * style, gchar * btn_name, gchar ** xpm)
 {
@@ -697,20 +641,29 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
 
 
 void
-on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data)
+on_set_option_mode1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-       show_all = GTK_CHECK_MENU_ITEM(menuitem)->active;
+       opt_mode = OPT_NORMAL;
+       gtk_tree_store_clear(tree2);
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
+}
+
 
+void
+on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data)
+{
+       opt_mode = OPT_ALL;
        gtk_tree_store_clear(tree2);
-       display_tree(&rootmenu);        // instead of update_tree to speed-up
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
 }
 
 
 void
-on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data)
+on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-       show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active;
-       update_tree(&rootmenu, NULL);
+       opt_mode = OPT_PROMPT;
+       gtk_tree_store_clear(tree2);
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
 }
 
 
@@ -1163,7 +1116,10 @@ static gchar **fill_row(struct menu *menu)
            g_strdup_printf("%s %s", _(menu_get_prompt(menu)),
                            sym && sym_has_value(sym) ? "(NEW)" : "");
 
-       if (show_all && !menu_is_visible(menu))
+       if (opt_mode == OPT_ALL && !menu_is_visible(menu))
+               row[COL_COLOR] = g_strdup("DarkGray");
+       else if (opt_mode == OPT_PROMPT &&
+                       menu_has_prompt(menu) && !menu_is_visible(menu))
                row[COL_COLOR] = g_strdup("DarkGray");
        else
                row[COL_COLOR] = g_strdup("Black");
@@ -1386,16 +1342,19 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
                       menu2 ? menu_get_prompt(menu2) : "nil");
 #endif
 
-               if (!menu_is_visible(child1) && !show_all) {    // remove node
+               if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) ||
+                   (opt_mode == OPT_PROMPT && !menu_has_prompt(child1))) {
+
+                       /* remove node */
                        if (gtktree_iter_find_node(dst, menu1) != NULL) {
                                memcpy(&tmp, child2, sizeof(GtkTreeIter));
                                valid = gtk_tree_model_iter_next(model2,
                                                                 child2);
                                gtk_tree_store_remove(tree2, &tmp);
                                if (!valid)
-                                       return; // next parent
+                                       return;         /* next parent */
                                else
-                                       goto reparse;   // next child
+                                       goto reparse;   /* next child */
                        } else
                                continue;
                }
@@ -1464,17 +1423,19 @@ static void display_tree(struct menu *menu)
                    && (tree == tree2))
                        continue;
 
-               if (menu_is_visible(child) || show_all)
+               if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
+                   (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
+                   (opt_mode == OPT_ALL))
                        place_node(child, fill_row(child));
 #ifdef DEBUG
                printf("%*c%s: ", indent, ' ', menu_get_prompt(child));
                printf("%s", child->flags & MENU_ROOT ? "rootmenu | " : "");
-               dbg_print_ptype(ptype);
+               printf("%s", prop_get_type_name(ptype));
                printf(" | ");
                if (sym) {
-                       dbg_print_stype(sym->type);
+                       printf("%s", sym_type_name(sym->type));
                        printf(" | ");
-                       dbg_print_flags(sym->flags);
+                       printf("%s", dbg_sym_flags(sym->flags));
                        printf("\n");
                } else
                        printf("\n");
index b1c86c19292cb01d43b8637acddcf701bf93d844..d52b0a75d8247c69a1c153b3e39072c596c551ef 100644 (file)
                  </child>
 
                  <child>
-                   <widget class="GtkCheckMenuItem" id="show_all_options1">
+                   <widget class="GtkRadioMenuItem" id="set_option_mode1">
+                     <property name="visible">True</property>
+                     <property name="tooltip" translatable="yes">Show normal options</property>
+                     <property name="label" translatable="yes">Show normal options</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="activate" handler="on_set_option_mode1_activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="set_option_mode2">
                      <property name="visible">True</property>
                      <property name="tooltip" translatable="yes">Show all options</property>
                      <property name="label" translatable="yes">Show all _options</property>
                      <property name="use_underline">True</property>
                      <property name="active">False</property>
-                     <signal name="activate" handler="on_show_all_options1_activate"/>
+                     <property name="group">set_option_mode1</property>
+                     <signal name="activate" handler="on_set_option_mode2_activate"/>
                    </widget>
                  </child>
 
                  <child>
-                   <widget class="GtkCheckMenuItem" id="show_debug_info1">
+                   <widget class="GtkRadioMenuItem" id="set_option_mode3">
                      <property name="visible">True</property>
-                     <property name="tooltip" translatable="yes">Show masked options</property>
-                     <property name="label" translatable="yes">Show _debug info</property>
+                     <property name="tooltip" translatable="yes">Show all options with prompts</property>
+                     <property name="label" translatable="yes">Show all prompt options</property>
                      <property name="use_underline">True</property>
                      <property name="active">False</property>
-                     <signal name="activate" handler="on_show_debug_info1_activate"/>
+                     <property name="group">set_option_mode1</property>
+                     <signal name="activate" handler="on_set_option_mode3_activate"/>
                    </widget>
                  </child>
+
                </widget>
              </child>
            </widget>
index e6439fc4786ac366a6a951231272f83765124e2c..999d42bcd3fca45920fa02d51bdcc0975767a39f 100644 (file)
@@ -84,7 +84,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode);
 void kconfig_load(void);
 
 /* menu.c */
-void menu_init(void);
+void _menu_init(void);
 void menu_warn(struct menu *menu, const char *fmt, ...);
 struct menu *menu_add_menu(void);
 void menu_end_menu(void);
@@ -106,6 +106,11 @@ int file_write_dep(const char *name);
 struct gstr {
        size_t len;
        char  *s;
+       /*
+       * when max_width is not zero long lines in string s (if any) get
+       * wrapped not to exceed the max_width value
+       */
+       int max_width;
 };
 struct gstr str_new(void);
 struct gstr str_assign(const char *s);
index ffeb532b2cff3a71705693f132dc5a5eb9d94bf4..7cadcad8233bb37cd8c2e40ccae7d999a1284a63 100644 (file)
@@ -11,13 +11,15 @@ P(conf_set_changed_callback, void,(void (*fn)(void)));
 /* menu.c */
 P(rootmenu,struct menu,);
 
-P(menu_is_visible,bool,(struct menu *menu));
+P(menu_is_visible, bool, (struct menu *menu));
+P(menu_has_prompt, bool, (struct menu *menu));
 P(menu_get_prompt,const char *,(struct menu *menu));
 P(menu_get_root_menu,struct menu *,(struct menu *menu));
 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
 P(menu_has_help,bool,(struct menu *menu));
 P(menu_get_help,const char *,(struct menu *menu));
-P(get_symbol_str,void,(struct gstr *r, struct symbol *sym));
+P(get_symbol_str, void, (struct gstr *r, struct symbol *sym));
+P(get_relations_str, struct gstr, (struct symbol **sym_arr));
 P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
 
 /* symbol.c */
index 616c60138183c8c9b74c3f2562f7e4a1e5b6d5d9..dd8e587c50e26eada18fe35995aaa0ec301f42fc 100644 (file)
@@ -180,7 +180,7 @@ do_resize:
                case KEY_LEFT:
                        switch (button) {
                        case -1:
-                               button = 1;     /* Indicates "Cancel" button is selected */
+                               button = 1;     /* Indicates "Help" button is selected */
                                print_buttons(dialog, height, width, 1);
                                break;
                        case 0:
@@ -204,7 +204,7 @@ do_resize:
                                print_buttons(dialog, height, width, 0);
                                break;
                        case 0:
-                               button = 1;     /* Indicates "Cancel" button is selected */
+                               button = 1;     /* Indicates "Help" button is selected */
                                print_buttons(dialog, height, width, 1);
                                break;
                        case 1:
index fa9d633f293c7c3a107b956e15774afd27560b12..1d604738fa1314a3479362082208b3591385d890 100644 (file)
@@ -383,6 +383,10 @@ do_resize:
                case 'n':
                case 'm':
                case '/':
+               case 'h':
+               case '?':
+               case 'z':
+               case '\n':
                        /* save scroll info */
                        *s_scroll = scroll;
                        delwin(menu);
@@ -390,8 +394,10 @@ do_resize:
                        item_set(scroll + choice);
                        item_set_selected(1);
                        switch (key) {
+                       case 'h':
+                       case '?':
+                               return 2;
                        case 's':
-                               return 3;
                        case 'y':
                                return 3;
                        case 'n':
@@ -402,18 +408,12 @@ do_resize:
                                return 6;
                        case '/':
                                return 7;
+                       case 'z':
+                               return 8;
+                       case '\n':
+                               return button;
                        }
                        return 0;
-               case 'h':
-               case '?':
-                       button = 2;
-               case '\n':
-                       *s_scroll = scroll;
-                       delwin(menu);
-                       delwin(dialog);
-                       item_set(scroll + choice);
-                       item_set_selected(1);
-                       return button;
                case 'e':
                case 'x':
                        key = KEY_ESC;
index a760b196e32d5966097ec940164620587ba36452..bf5f1cb568d27ab812dad181f74c5b46eb371116 100644 (file)
@@ -70,13 +70,15 @@ static const char mconf_readme[] = N_(
 "             there is a delayed response which you may find annoying.\n"
 "\n"
 "   Also, the <TAB> and cursor keys will cycle between <Select>,\n"
-"   <Exit> and <Help>\n"
+"   <Exit> and <Help>.\n"
 "\n"
 "o  To get help with an item, use the cursor keys to highlight <Help>\n"
-"   and Press <ENTER>.\n"
+"   and press <ENTER>.\n"
 "\n"
 "   Shortcut: Press <H> or <?>.\n"
 "\n"
+"o  To show hidden options, press <Z>.\n"
+"\n"
 "\n"
 "Radiolists  (Choice lists)\n"
 "-----------\n"
@@ -275,6 +277,7 @@ static int indent;
 static struct menu *current_menu;
 static int child_count;
 static int single_menu_mode;
+static int show_all_options;
 
 static void conf(struct menu *menu);
 static void conf_choice(struct menu *menu);
@@ -285,19 +288,6 @@ static void show_textbox(const char *title, const char *text, int r, int c);
 static void show_helptext(const char *title, const char *text);
 static void show_help(struct menu *menu);
 
-static struct gstr get_relations_str(struct symbol **sym_arr)
-{
-       struct symbol *sym;
-       struct gstr res = str_new();
-       int i;
-
-       for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
-               get_symbol_str(&res, sym);
-       if (!i)
-               str_append(&res, _("No matches found.\n"));
-       return res;
-}
-
 static char filename[PATH_MAX+1];
 static void set_config_filename(const char *config_filename)
 {
@@ -362,8 +352,16 @@ static void build_conf(struct menu *menu)
        int type, tmp, doint = 2;
        tristate val;
        char ch;
-
-       if (!menu_is_visible(menu))
+       bool visible;
+
+       /*
+        * note: menu_is_visible() has side effect that it will
+        * recalc the value of the symbol.
+        */
+       visible = menu_is_visible(menu);
+       if (show_all_options && !menu_has_prompt(menu))
+               return;
+       else if (!show_all_options && !visible)
                return;
 
        sym = menu->sym;
@@ -622,6 +620,9 @@ static void conf(struct menu *menu)
                case 7:
                        search_conf();
                        break;
+               case 8:
+                       show_all_options = !show_all_options;
+                       break;
                }
        }
 }
@@ -641,6 +642,7 @@ static void show_help(struct menu *menu)
 {
        struct gstr help = str_new();
 
+       help.max_width = getmaxx(stdscr) - 10;
        menu_get_ext_help(menu, &help);
 
        show_helptext(_(menu_get_prompt(menu)), str_get(&help));
index 059a2465c5744ffed6d3cff25e2d8135a16c0399..203632cc30bdbe12ad0644c3aff15ed07a4e7c0d 100644 (file)
@@ -38,7 +38,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...)
        va_end(ap);
 }
 
-void menu_init(void)
+void _menu_init(void)
 {
        current_entry = current_menu = &rootmenu;
        last_entry_ptr = &rootmenu.list;
@@ -197,7 +197,7 @@ static void sym_check_prop(struct symbol *sym)
                        if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
                            prop->expr->type != E_SYMBOL)
                                prop_warn(prop,
-                                   "default for config symbol '%'"
+                                   "default for config symbol '%s'"
                                    " must be a single symbol", sym->name);
                        break;
                case P_SELECT:
@@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent)
        }
 }
 
+bool menu_has_prompt(struct menu *menu)
+{
+       if (!menu->prompt)
+               return false;
+       return true;
+}
+
 bool menu_is_visible(struct menu *menu)
 {
        struct menu *child;
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu)
 
        if (!menu->prompt)
                return false;
+
        sym = menu->sym;
        if (sym) {
                sym_calc_value(sym);
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu)
 
        if (visible != no)
                return true;
+
        if (!sym || sym_get_tristate_value(menu->sym) == no)
                return false;
 
        for (child = menu->list; child; child = child->next)
                if (menu_is_visible(child))
                        return true;
+
        return false;
 }
 
@@ -515,6 +525,20 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
        str_append(r, "\n\n");
 }
 
+struct gstr get_relations_str(struct symbol **sym_arr)
+{
+       struct symbol *sym;
+       struct gstr res = str_new();
+       int i;
+
+       for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
+               get_symbol_str(&res, sym);
+       if (!i)
+               str_append(&res, _("No matches found.\n"));
+       return res;
+}
+
+
 void menu_get_ext_help(struct menu *menu, struct gstr *help)
 {
        struct symbol *sym = menu->sym;
index 6c8fbbb66ebcaddefff183696d1c5d89bc2d6c09..2e7a048e0cfceb32970d4d0a6fa8b211d70ef83e 100644 (file)
@@ -651,12 +651,20 @@ bool sym_is_changable(struct symbol *sym)
        return sym->visible > sym->rev_dep.tri;
 }
 
+static unsigned strhash(const char *s)
+{
+       /* fnv32 hash */
+       unsigned hash = 2166136261U;
+       for (; *s; s++)
+               hash = (hash ^ *s) * 0x01000193;
+       return hash;
+}
+
 struct symbol *sym_lookup(const char *name, int flags)
 {
        struct symbol *symbol;
-       const char *ptr;
        char *new_name;
-       int hash = 0;
+       int hash;
 
        if (name) {
                if (name[0] && !name[1]) {
@@ -666,12 +674,11 @@ struct symbol *sym_lookup(const char *name, int flags)
                        case 'n': return &symbol_no;
                        }
                }
-               for (ptr = name; *ptr; ptr++)
-                       hash += *ptr;
-               hash &= 0xff;
+               hash = strhash(name) % SYMBOL_HASHSIZE;
 
                for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
-                       if (!strcmp(symbol->name, name) &&
+                       if (symbol->name &&
+                           !strcmp(symbol->name, name) &&
                            (flags ? symbol->flags & flags
                                   : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
                                return symbol;
@@ -679,7 +686,7 @@ struct symbol *sym_lookup(const char *name, int flags)
                new_name = strdup(name);
        } else {
                new_name = NULL;
-               hash = 256;
+               hash = 0;
        }
 
        symbol = malloc(sizeof(*symbol));
@@ -697,7 +704,6 @@ struct symbol *sym_lookup(const char *name, int flags)
 struct symbol *sym_find(const char *name)
 {
        struct symbol *symbol = NULL;
-       const char *ptr;
        int hash = 0;
 
        if (!name)
@@ -710,12 +716,11 @@ struct symbol *sym_find(const char *name)
                case 'n': return &symbol_no;
                }
        }
-       for (ptr = name; *ptr; ptr++)
-               hash += *ptr;
-       hash &= 0xff;
+       hash = strhash(name) % SYMBOL_HASHSIZE;
 
        for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
-               if (!strcmp(symbol->name, name) &&
+               if (symbol->name &&
+                   !strcmp(symbol->name, name) &&
                    !(symbol->flags & SYMBOL_CONST))
                                break;
        }
@@ -750,6 +755,7 @@ struct symbol **sym_re_search(const char *pattern)
                                return NULL;
                        }
                }
+               sym_calc_value(sym);
                sym_arr[cnt++] = sym;
        }
        if (sym_arr)
index b6b2a46af14c400b556b61c3f6e1caeed792a87a..78b5c04e736bcfad3f25d7f85fe2b5660572cb52 100644 (file)
@@ -72,12 +72,13 @@ int file_write_dep(const char *name)
 }
 
 
-/* Allocate initial growable sting */
+/* Allocate initial growable string */
 struct gstr str_new(void)
 {
        struct gstr gs;
        gs.s = malloc(sizeof(char) * 64);
        gs.len = 64;
+       gs.max_width = 0;
        strcpy(gs.s, "\0");
        return gs;
 }
@@ -88,6 +89,7 @@ struct gstr str_assign(const char *s)
        struct gstr gs;
        gs.s = strdup(s);
        gs.len = strlen(s) + 1;
+       gs.max_width = 0;
        return gs;
 }
 
index 76180653231d4b46b89b003a33cd67b517a1717b..3323367adfad6f7a75dfdd2a7b1457ff0b965eec 100644 (file)
@@ -104,7 +104,7 @@ static void zconf_error(const char *err, ...);
 static void zconferror(const char *err);
 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
 
-struct symbol *symbol_hash[257];
+struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 
 static struct menu *current_menu, *current_entry;
 
@@ -2220,7 +2220,7 @@ void conf_parse(const char *name)
        zconf_initscan(name);
 
        sym_init();
-       menu_init();
+       _menu_init();
        modules_sym = sym_lookup(NULL, 0);
        modules_sym->type = S_BOOLEAN;
        modules_sym->flags |= SYMBOL_AUTO;
@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu)
        struct property *prop;
 
        if (sym_is_choice(sym))
-               fprintf(out, "choice\n");
+               fprintf(out, "\nchoice\n");
        else
-               fprintf(out, "config %s\n", sym->name);
+               fprintf(out, "\nconfig %s\n", sym->name);
        switch (sym->type) {
        case S_BOOLEAN:
                fputs("  boolean\n", out);
@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu)
                case P_CHOICE:
                        fputs("  #choice value\n", out);
                        break;
+               case P_SELECT:
+                       fputs( "  select ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_RANGE:
+                       fputs( "  range ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_MENU:
+                       fputs( "  menu ", out);
+                       print_quoted_string(out, prop->text);
+                       fputc('\n', out);
+                       break;
                default:
                        fprintf(out, "  unknown prop %d!\n", prop->type);
                        break;
@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu)
                        menu->help[len] = 0;
                fprintf(out, "  help\n%s\n", menu->help);
        }
-       fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out)
                                expr_fprint(prop->visible.expr, out);
                                fputc('\n', out);
                        }
-                       fputs("\n", out);
                }
 
                if (menu->list)
index 8c43491f8cc9635cde61b9f80a98598a77948d75..23dfd3baa7a1ba906c80a0df0383fbfcf8979bad 100644 (file)
@@ -27,7 +27,7 @@ static void zconf_error(const char *err, ...);
 static void zconferror(const char *err);
 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
 
-struct symbol *symbol_hash[257];
+struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 
 static struct menu *current_menu, *current_entry;
 
@@ -475,7 +475,7 @@ void conf_parse(const char *name)
        zconf_initscan(name);
 
        sym_init();
-       menu_init();
+       _menu_init();
        modules_sym = sym_lookup(NULL, 0);
        modules_sym->type = S_BOOLEAN;
        modules_sym->flags |= SYMBOL_AUTO;
@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu)
        struct property *prop;
 
        if (sym_is_choice(sym))
-               fprintf(out, "choice\n");
+               fprintf(out, "\nchoice\n");
        else
-               fprintf(out, "config %s\n", sym->name);
+               fprintf(out, "\nconfig %s\n", sym->name);
        switch (sym->type) {
        case S_BOOLEAN:
                fputs("  boolean\n", out);
@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu)
                case P_CHOICE:
                        fputs("  #choice value\n", out);
                        break;
+               case P_SELECT:
+                       fputs( "  select ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_RANGE:
+                       fputs( "  range ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_MENU:
+                       fputs( "  menu ", out);
+                       print_quoted_string(out, prop->text);
+                       fputc('\n', out);
+                       break;
                default:
                        fprintf(out, "  unknown prop %d!\n", prop->type);
                        break;
@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu)
                        menu->help[len] = 0;
                fprintf(out, "  help\n%s\n", menu->help);
        }
-       fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -683,7 +697,6 @@ void zconfdump(FILE *out)
                                expr_fprint(prop->visible.expr, out);
                                fputc('\n', out);
                        }
-                       fputs("\n", out);
                }
 
                if (menu->list)
index 5c165f7ee39e66003dbbaa7b48f90a86283dd788..9d81b9d62f2d3b7412096a1a040e081c8a44228b 100644 (file)
@@ -48,7 +48,7 @@ kconfig_call = $(MAKE) -C $(L4DIR)/tool/kconfig O=$(OBJ_BASE) \
               KCONFIG_AUTOCONFIG=.kconfig.auto \
               KCONFIG_TRISTATE=.kconfig.tristate \
               KERNELVERSION=SVN \
-              fiasco_srcdir=$(L4DIR_ABS)
+              l4re_srcdir=$(L4DIR_ABS)
 
 
 DROPSCONF              ?=
index 0b347b039ea0fd8a81ec6828c42c53dd6000eb38..e50bc665398c8bdb19672619a7102059079d81cc 100644 (file)
@@ -75,7 +75,7 @@ static int net_recv_irq(struct sk_buff *skb)
        /*
         * Push eth header back, so that skb->data is the raw packet.
         */
-       skb_push(skb, skb->dev->hard_header_len);
+       skb_push(skb, ETH_HLEN);
 
        /*
         * Hand to upper layers.
@@ -164,21 +164,21 @@ int netdev_xmit(void *netdev, char *addr, unsigned len)
 {
        // XXX could we pass 0 as length here? data netdev is set
        //     below anyway
-    struct sk_buff *skb = alloc_skb(len, GFP_KERNEL);
-    assert(skb);
+       struct sk_buff *skb = alloc_skb(len, GFP_KERNEL);
+       assert(skb);
 
-    skb->data = addr; // XXX
-    skb->len  = len;
-    skb->dev  = ND(netdev);
+       skb->data = addr; // XXX
+       skb_put(skb, len);
+       skb->dev  = ND(netdev);
 
-    while (netif_queue_stopped(ND(netdev)))
+       while (netif_queue_stopped(ND(netdev)))
                msleep(1);
 
-    int err;
-    if (ND(netdev)->netdev_ops)
-        err = ND(netdev)->netdev_ops->ndo_start_xmit(skb, ND(netdev));
-    else
-        err = ND(netdev)->hard_start_xmit(skb, ND(netdev));
+       int err;
+       if (ND(netdev)->netdev_ops)
+               err = ND(netdev)->netdev_ops->ndo_start_xmit(skb, ND(netdev));
+       else
+               err = ND(netdev)->hard_start_xmit(skb, ND(netdev));
 
-    return err;
+       return err;
 }
index 26e1639889b0731375b6932592355a114eb6f9a0..64e9877839000e61e55b37eefb37d208dca62e35 100644 (file)
@@ -50,7 +50,8 @@ static irqreturn_t ux_interrupt(int irq, void *dev_id)
                dev_kfree_skb(skb);
                return IRQ_HANDLED;
        }
-       skb->len = ret;
+
+       skb_put(skb, ret);
 
        /* ACK interrupt */
        lx_kill(priv->prov_pid, SIGUSR1);
index d106fe338d381c8b934983328de60a9a02157c62..6aee7c3dcf92745491f4699198e5cfd9ff62313b 100644 (file)
@@ -179,7 +179,7 @@ void *find_kip()
 
 const char *get_cmdline(l4util_mb_info_t *mbi)
 {
-  if (mbi->flags & L4UTIL_MB_CMDLINE)
+  if (mbi && mbi->flags & L4UTIL_MB_CMDLINE)
     return L4_CHAR_PTR(mbi->cmdline);
 
   if (*builtin_cmdline)
index 00d5a156e2046b86b21276afef45e9e52ab1e551..bad10f3bea5e197adc1525573234e59ed16f7afa 100644 (file)
@@ -376,18 +376,18 @@ public:
 Dope_fb::Dope_fb(const char *configstr)
 {
   unsigned long val;
-  unsigned xpos = 20, ypos = 20;
+  unsigned xpos = 20, ypos = 20, w, h;
 
   dope_registry->register_obj(this);
 
   _screen_info.width     = 300;
   _screen_info.height    = 200;
 
-
-  if (get_val(configstr, "w=", &val))
-    _screen_info.width  = val;
-  if (get_val(configstr, "h=", &val))
-    _screen_info.height = val;
+  if (sscanf(configstr, "%dx%d", &w, &h) == 2)
+    {
+      _screen_info.width = w;
+      _screen_info.height = h;
+    }
 
   if (get_val(configstr, "x=", &val))
     xpos = val;
index c79f7113eaf6b40d32ae1186848ee228b45f8ee6..e07ec02385a7ab5c60bbb3740b1cfa91f06af69f 100644 (file)
@@ -107,7 +107,7 @@ int lua(int argc, char const *const *argv)
 
   if (luaL_loadbuffer(L, _binary_ned_lua_start, _binary_ned_lua_end - _binary_ned_lua_start, "@ned.lua"))
     {
-      printf("script: ---\n%.*s\n---", (int)(_binary_ned_lua_end - _binary_ned_lua_start), _binary_ned_lua_start);
+      printf("Ned: script: ---\n%.*s\n---", (int)(_binary_ned_lua_end - _binary_ned_lua_start), _binary_ned_lua_start);
       fprintf(stderr, "lua error: %s.\n", lua_tostring(L, -1));
       lua_pop(L, lua_gettop(L));
       return 0;
@@ -124,12 +124,12 @@ int lua(int argc, char const *const *argv)
 
   for (int c = optind; c < argc; ++c)
     {
-      printf("loading file: '%s'\n", argv[c]);
+      printf("Ned: loading file: '%s'\n", argv[c]);
       int e = luaL_dofile(L, argv[c]);
       if (e)
        {
          char const *error = lua_tostring(L, -1);
-         printf("ERROR: %s\n", error);
+         printf("Ned: ERROR: %s\n", error);
        }
       lua_pop(L, lua_gettop(L));
     }
index d9bed0a3f1c90a33ccd2e962cab1ddde100a0e54..40e455b3d5bac6d3f7b3735a8e9f55ab660f2657 100644 (file)
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 34
+SUBLEVEL = 35
 EXTRAVERSION =
 NAME = Sheep on Meth
 
@@ -183,11 +183,14 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 # CROSS_COMPILE can be set on the command line
 # make CROSS_COMPILE=ia64-linux-
 # Alternatively CROSS_COMPILE can be set in the environment.
+# A third alternative is to store a setting in .config so that plain
+# "make" in the configured kernel build directory always uses that.
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 export KBUILD_BUILDHOST := $(SUBARCH)
 ARCH           ?= $(SUBARCH)
 CROSS_COMPILE  ?=
+CROSS_COMPILE  ?= $(CONFIG_CROSS_COMPILE:"%"=%)
 
 # Architecture as present in compile.h
 UTS_MACHINE    := $(ARCH)
@@ -576,9 +579,6 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 # disable invalid "can't wrap" optimizations for signed / pointers
 KBUILD_CFLAGS  += $(call cc-option,-fno-strict-overflow)
 
-# revert to pre-gcc-4.4 behaviour of .eh_frame
-KBUILD_CFLAGS  += $(call cc-option,-fno-dwarf2-cfi-asm)
-
 # conserve stack if available
 KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
 
@@ -882,73 +882,11 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
 PHONY += $(vmlinux-dirs)
 $(vmlinux-dirs): prepare scripts
        $(Q)$(MAKE) $(build)=$@
-ifdef CONFIG_MODULES
-       $(Q)$(MAKE) $(modbuiltin)=$@
-endif
-
-# Build the kernel release string
-#
-# The KERNELRELEASE value built here is stored in the file
-# include/config/kernel.release, and is used when executing several
-# make targets, such as "make install" or "make modules_install."
-#
-# The eventual kernel release string consists of the following fields,
-# shown in a hierarchical format to show how smaller parts are concatenated
-# to form the larger and final value, with values coming from places like
-# the Makefile, kernel config options, make command line options and/or
-# SCM tag information.
-#
-#      $(KERNELVERSION)
-#        $(VERSION)                    eg, 2
-#        $(PATCHLEVEL)                 eg, 6
-#        $(SUBLEVEL)                   eg, 18
-#        $(EXTRAVERSION)               eg, -rc6
-#      $(localver-full)
-#        $(localver)
-#          localversion*               (files without backups, containing '~')
-#          $(CONFIG_LOCALVERSION)      (from kernel config setting)
-#        $(localver-auto)              (only if CONFIG_LOCALVERSION_AUTO is set)
-#          ./scripts/setlocalversion   (SCM tag, if one exists)
-#          $(LOCALVERSION)             (from make command line if provided)
-#
-#  Note how the final $(localver-auto) string is included *only* if the
-# kernel config option CONFIG_LOCALVERSION_AUTO is selected.  Also, at the
-# moment, only git is supported but other SCMs can edit the script
-# scripts/setlocalversion and add the appropriate checks as needed.
-
-pattern = ".*/localversion[^~]*"
-string  = $(shell cat /dev/null \
-          `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`)
-
-localver = $(subst $(space),, $(string) \
-                             $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
-
-# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
-# and if the SCM is know a tag from the SCM is appended.
-# The appended tag is determined by the SCM used.
-#
-# .scmversion is used when generating rpm packages so we do not loose
-# the version information from the SCM when we do the build of the kernel
-# from the copied source
-ifdef CONFIG_LOCALVERSION_AUTO
-
-ifeq ($(wildcard .scmversion),)
-        _localver-auto = $(shell $(CONFIG_SHELL) \
-                         $(srctree)/scripts/setlocalversion $(srctree))
-else
-        _localver-auto = $(shell cat .scmversion 2> /dev/null)
-endif
-
-       localver-auto  = $(LOCALVERSION)$(_localver-auto)
-endif
-
-localver-full = $(localver)$(localver-auto)
 
 # Store (new) KERNELRELASE string in include/config/kernel.release
-kernelrelease = $(KERNELVERSION)$(localver-full)
 include/config/kernel.release: include/config/auto.conf FORCE
        $(Q)rm -f $@
-       $(Q)echo $(kernelrelease) > $@
+       $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
 
 
 # Things we need to do before we recursively start building the kernel
@@ -1087,13 +1025,18 @@ all: modules
 #      using awk while concatenating to the final file.
 
 PHONY += modules
-modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
+modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
        $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
-       $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
        @$(kecho) '  Building modules, stage 2.';
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
 
+modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+       $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
+
+%/modules.builtin: include/config/auto.conf
+       $(Q)$(MAKE) $(modbuiltin)=$*
+
 
 # Target to prepare building external modules
 PHONY += modules_prepare
@@ -1247,7 +1190,9 @@ help:
        @echo  '  firmware_install- Install all firmware to INSTALL_FW_PATH'
        @echo  '                    (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
        @echo  '  dir/            - Build all files in dir and below'
-       @echo  '  dir/file.[ois]  - Build specified target only'
+       @echo  '  dir/file.[oisS] - Build specified target only'
+       @echo  '  dir/file.lst    - Build specified mixed source/assembly target only'
+       @echo  '                    (requires a recent binutils and recent build (System.map))'
        @echo  '  dir/file.ko     - Build module including final link'
        @echo  '  modules_prepare - Set up for building external modules'
        @echo  '  tags/TAGS       - Generate tags file for editors'
index 9aa5d1f01a586b8563456d37936808a6540b77ca..1ca79add8d224fd41842afb1b211917eec0f65de 100644 (file)
@@ -1,3 +1,3 @@
 
-kconfig taken from vanilla Linux 2.6.34, and slightly patched.
+kconfig taken from vanilla Linux 2.6.35, and slightly patched.
 
index 0b94d2fa3a883ce4cf1b9bdd6219e30bc338f480..e4deb73e9a84971d46ac3dab9bd96cf8ffc8236f 100644 (file)
@@ -82,7 +82,7 @@ ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
 lib-target := $(obj)/lib.a
 endif
 
-ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),)
+ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m) $(lib-target)),)
 builtin-target := $(obj)/built-in.o
 endif
 
index f9bdf264473db421f4a720eaca0d4c5456e4d7e6..54fd1b700131e1e1fcb0ddd13d89ee3a06983ecb 100644 (file)
@@ -241,7 +241,11 @@ cmd_lzma = (cat $(filter-out FORCE,$^) | \
        lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
        (rm -f $@ ; false)
 
-quiet_cmd_lzo = LZO    $@
+quiet_cmd_lzo = LZO     $@
 cmd_lzo = (cat $(filter-out FORCE,$^) | \
        lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
        (rm -f $@ ; false)
+
+# misc stuff
+# ---------------------------------------------------------------------------
+quote:="
index 186c46604d0669f8f1d4cfbcaf7ad0cdc6d658fa..7ea649da19400252ba751bfdb8bea5e7a5dba426 100644 (file)
@@ -23,6 +23,9 @@ menuconfig: $(obj)/mconf
 config: $(obj)/conf
        $< $(Kconfig)
 
+nconfig: $(obj)/nconf
+       $< $(Kconfig)
+
 oldconfig: $(obj)/conf
        $< -o $(Kconfig)
 
@@ -120,6 +123,7 @@ endif
 # Help text used by make help
 help:
        @echo  '  config          - Update current config utilising a line-oriented program'
+       @echo  '  nconfig         - Update current config utilising a ncurses menu based program'
        @echo  '  menuconfig      - Update current config utilising a menu based program'
        @echo  '  xconfig         - Update current config utilising a QT based front-end'
        @echo  '  gconfig         - Update current config utilising a GTK based front-end'
@@ -147,6 +151,8 @@ HOST_EXTRACFLAGS += -DLOCALE
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
 # conf:          Used for defconfig, oldconfig and related targets
+# nconf:  Used for the nconfig target.
+#         Utilizes ncurses
 # mconf:  Used for the menuconfig target
 #         Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
@@ -159,11 +165,16 @@ lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
 lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
 
 conf-objs      := conf.o  zconf.tab.o
-mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+nconf-objs     := nconf.o zconf.tab.o nconf.gui.o
 kxgettext-objs := kxgettext.o zconf.tab.o
 
 hostprogs-y := conf qconf gconf kxgettext
 
+ifeq ($(MAKECMDGOALS),nconfig)
+       hostprogs-y += nconf
+endif
+
 ifeq ($(MAKECMDGOALS),menuconfig)
        hostprogs-y += mconf
 endif
@@ -187,7 +198,7 @@ endif
 
 clean-files    := lkc_defs.h qconf.moc .tmp_qtcheck \
                   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
-clean-files     += mconf qconf gconf
+clean-files     += mconf qconf gconf nconf
 clean-files     += config.pot linux.pot
 
 # Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
@@ -208,10 +219,11 @@ HOSTCFLAGS_zconf.tab.o    := -I$(src)
 HOSTLOADLIBES_qconf    = $(KC_QT_LIBS) -ldl
 HOSTCXXFLAGS_qconf.o   = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
 
-HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
+HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl
 HOSTCFLAGS_gconf.o     = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
                           -D LKC_DIRECT_LINK
 
+HOSTLOADLIBES_nconf    = -lmenu -lpanel -lncurses
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)
index edd3f39a080a422175bf512c94dd1d5bf87e059b..d83f2322893a8adb10f027e2c4fa4757a33e26f0 100644 (file)
@@ -1097,9 +1097,32 @@ void expr_fprint(struct expr *e, FILE *out)
 
 static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str)
 {
-       str_append((struct gstr*)data, str);
+       struct gstr *gs = (struct gstr*)data;
+       const char *sym_str = NULL;
+
+       if (sym)
+               sym_str = sym_get_string_value(sym);
+
+       if (gs->max_width) {
+               unsigned extra_length = strlen(str);
+               const char *last_cr = strrchr(gs->s, '\n');
+               unsigned last_line_length;
+
+               if (sym_str)
+                       extra_length += 4 + strlen(sym_str);
+
+               if (!last_cr)
+                       last_cr = gs->s;
+
+               last_line_length = strlen(gs->s) - (last_cr - gs->s);
+
+               if ((last_line_length + extra_length) > gs->max_width)
+                       str_append(gs, "\\\n");
+       }
+
+       str_append(gs, str);
        if (sym)
-               str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym));
+               str_printf(gs, " [=%s]", sym_str);
 }
 
 void expr_gstr_print(struct expr *e, struct gstr *gs)
index 6408fefae083703e2fa3d8e8a3d4f8a814f44f0b..891cd9ce9ba21b915d0b0aa993fc2d0c8d2fb10c 100644 (file)
@@ -86,7 +86,7 @@ struct symbol {
        struct expr_value rev_dep;
 };
 
-#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 for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
 
 #define SYMBOL_CONST      0x0001  /* symbol is const */
 #define SYMBOL_CHECK      0x0008  /* used during dependency checking */
@@ -108,8 +108,7 @@ struct symbol {
 #define SYMBOL_DEF4       0x80000  /* symbol.def[S_DEF_4] is valid */
 
 #define SYMBOL_MAXLENGTH       256
-#define SYMBOL_HASHSIZE                257
-#define SYMBOL_HASHMASK                0xff
+#define SYMBOL_HASHSIZE                9973
 
 /* A property represent the config options that can be associated
  * with a config "symbol".
index 84cad4519d5a60e81b83a619844cd780f8a21733..feee4b05988365f03c738bce39d2091dabad30a1 100644 (file)
@@ -30,13 +30,16 @@ enum {
        SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW
 };
 
+enum {
+       OPT_NORMAL, OPT_ALL, OPT_PROMPT
+};
+
 static gint view_mode = FULL_VIEW;
 static gboolean show_name = TRUE;
 static gboolean show_range = TRUE;
 static gboolean show_value = TRUE;
-static gboolean show_all = FALSE;
-static gboolean show_debug = FALSE;
 static gboolean resizeable = FALSE;
+static int opt_mode = OPT_NORMAL;
 
 GtkWidget *main_wnd = NULL;
 GtkWidget *tree1_w = NULL;     // left  frame
@@ -76,36 +79,7 @@ static void conf_changed(void);
 
 /* Helping/Debugging Functions */
 
-
-const char *dbg_print_stype(int val)
-{
-       static char buf[256];
-
-       bzero(buf, 256);
-
-       if (val == S_UNKNOWN)
-               strcpy(buf, "unknown");
-       if (val == S_BOOLEAN)
-               strcpy(buf, "boolean");
-       if (val == S_TRISTATE)
-               strcpy(buf, "tristate");
-       if (val == S_INT)
-               strcpy(buf, "int");
-       if (val == S_HEX)
-               strcpy(buf, "hex");
-       if (val == S_STRING)
-               strcpy(buf, "string");
-       if (val == S_OTHER)
-               strcpy(buf, "other");
-
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
-
-       return buf;
-}
-
-const char *dbg_print_flags(int val)
+const char *dbg_sym_flags(int val)
 {
        static char buf[256];
 
@@ -131,40 +105,10 @@ const char *dbg_print_flags(int val)
                strcat(buf, "auto/");
 
        buf[strlen(buf) - 1] = '\0';
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
-
-       return buf;
-}
-
-const char *dbg_print_ptype(int val)
-{
-       static char buf[256];
-
-       bzero(buf, 256);
-
-       if (val == P_UNKNOWN)
-               strcpy(buf, "unknown");
-       if (val == P_PROMPT)
-               strcpy(buf, "prompt");
-       if (val == P_COMMENT)
-               strcpy(buf, "comment");
-       if (val == P_MENU)
-               strcpy(buf, "menu");
-       if (val == P_DEFAULT)
-               strcpy(buf, "default");
-       if (val == P_CHOICE)
-               strcpy(buf, "choice");
-
-#ifdef DEBUG
-       printf("%s", buf);
-#endif
 
        return buf;
 }
 
-
 void replace_button_icon(GladeXML * xml, GdkDrawable * window,
                         GtkStyle * style, gchar * btn_name, gchar ** xpm)
 {
@@ -697,20 +641,29 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
 
 
 void
-on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data)
+on_set_option_mode1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-       show_all = GTK_CHECK_MENU_ITEM(menuitem)->active;
+       opt_mode = OPT_NORMAL;
+       gtk_tree_store_clear(tree2);
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
+}
+
 
+void
+on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data)
+{
+       opt_mode = OPT_ALL;
        gtk_tree_store_clear(tree2);
-       display_tree(&rootmenu);        // instead of update_tree to speed-up
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
 }
 
 
 void
-on_show_debug_info1_activate(GtkMenuItem * menuitem, gpointer user_data)
+on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-       show_debug = GTK_CHECK_MENU_ITEM(menuitem)->active;
-       update_tree(&rootmenu, NULL);
+       opt_mode = OPT_PROMPT;
+       gtk_tree_store_clear(tree2);
+       display_tree(&rootmenu);        /* instead of update_tree to speed-up */
 }
 
 
@@ -1163,7 +1116,10 @@ static gchar **fill_row(struct menu *menu)
            g_strdup_printf("%s %s", _(menu_get_prompt(menu)),
                            sym && sym_has_value(sym) ? "(NEW)" : "");
 
-       if (show_all && !menu_is_visible(menu))
+       if (opt_mode == OPT_ALL && !menu_is_visible(menu))
+               row[COL_COLOR] = g_strdup("DarkGray");
+       else if (opt_mode == OPT_PROMPT &&
+                       menu_has_prompt(menu) && !menu_is_visible(menu))
                row[COL_COLOR] = g_strdup("DarkGray");
        else
                row[COL_COLOR] = g_strdup("Black");
@@ -1386,16 +1342,19 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
                       menu2 ? menu_get_prompt(menu2) : "nil");
 #endif
 
-               if (!menu_is_visible(child1) && !show_all) {    // remove node
+               if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) ||
+                   (opt_mode == OPT_PROMPT && !menu_has_prompt(child1))) {
+
+                       /* remove node */
                        if (gtktree_iter_find_node(dst, menu1) != NULL) {
                                memcpy(&tmp, child2, sizeof(GtkTreeIter));
                                valid = gtk_tree_model_iter_next(model2,
                                                                 child2);
                                gtk_tree_store_remove(tree2, &tmp);
                                if (!valid)
-                                       return; // next parent
+                                       return;         /* next parent */
                                else
-                                       goto reparse;   // next child
+                                       goto reparse;   /* next child */
                        } else
                                continue;
                }
@@ -1464,17 +1423,19 @@ static void display_tree(struct menu *menu)
                    && (tree == tree2))
                        continue;
 
-               if (menu_is_visible(child) || show_all)
+               if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
+                   (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
+                   (opt_mode == OPT_ALL))
                        place_node(child, fill_row(child));
 #ifdef DEBUG
                printf("%*c%s: ", indent, ' ', menu_get_prompt(child));
                printf("%s", child->flags & MENU_ROOT ? "rootmenu | " : "");
-               dbg_print_ptype(ptype);
+               printf("%s", prop_get_type_name(ptype));
                printf(" | ");
                if (sym) {
-                       dbg_print_stype(sym->type);
+                       printf("%s", sym_type_name(sym->type));
                        printf(" | ");
-                       dbg_print_flags(sym->flags);
+                       printf("%s", dbg_sym_flags(sym->flags));
                        printf("\n");
                } else
                        printf("\n");
index b1c86c19292cb01d43b8637acddcf701bf93d844..d52b0a75d8247c69a1c153b3e39072c596c551ef 100644 (file)
                  </child>
 
                  <child>
-                   <widget class="GtkCheckMenuItem" id="show_all_options1">
+                   <widget class="GtkRadioMenuItem" id="set_option_mode1">
+                     <property name="visible">True</property>
+                     <property name="tooltip" translatable="yes">Show normal options</property>
+                     <property name="label" translatable="yes">Show normal options</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="activate" handler="on_set_option_mode1_activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="set_option_mode2">
                      <property name="visible">True</property>
                      <property name="tooltip" translatable="yes">Show all options</property>
                      <property name="label" translatable="yes">Show all _options</property>
                      <property name="use_underline">True</property>
                      <property name="active">False</property>
-                     <signal name="activate" handler="on_show_all_options1_activate"/>
+                     <property name="group">set_option_mode1</property>
+                     <signal name="activate" handler="on_set_option_mode2_activate"/>
                    </widget>
                  </child>
 
                  <child>
-                   <widget class="GtkCheckMenuItem" id="show_debug_info1">
+                   <widget class="GtkRadioMenuItem" id="set_option_mode3">
                      <property name="visible">True</property>
-                     <property name="tooltip" translatable="yes">Show masked options</property>
-                     <property name="label" translatable="yes">Show _debug info</property>
+                     <property name="tooltip" translatable="yes">Show all options with prompts</property>
+                     <property name="label" translatable="yes">Show all prompt options</property>
                      <property name="use_underline">True</property>
                      <property name="active">False</property>
-                     <signal name="activate" handler="on_show_debug_info1_activate"/>
+                     <property name="group">set_option_mode1</property>
+                     <signal name="activate" handler="on_set_option_mode3_activate"/>
                    </widget>
                  </child>
+
                </widget>
              </child>
            </widget>
index e6439fc4786ac366a6a951231272f83765124e2c..e5a015f6a46870abd4b051dc58a4ff6da64efcbf 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #include "lkc_proto.h"
 #undef P
 
-#define SRCTREE "fiasco_srcdir"
+#define SRCTREE "l4re_srcdir"
 
 #define PACKAGE "linux"
 #define LOCALEDIR "/usr/share/locale"
@@ -84,7 +84,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode);
 void kconfig_load(void);
 
 /* menu.c */
-void menu_init(void);
+void _menu_init(void);
 void menu_warn(struct menu *menu, const char *fmt, ...);
 struct menu *menu_add_menu(void);
 void menu_end_menu(void);
@@ -106,6 +106,11 @@ int file_write_dep(const char *name);
 struct gstr {
        size_t len;
        char  *s;
+       /*
+       * when max_width is not zero long lines in string s (if any) get
+       * wrapped not to exceed the max_width value
+       */
+       int max_width;
 };
 struct gstr str_new(void);
 struct gstr str_assign(const char *s);
index ffeb532b2cff3a71705693f132dc5a5eb9d94bf4..7cadcad8233bb37cd8c2e40ccae7d999a1284a63 100644 (file)
@@ -11,13 +11,15 @@ P(conf_set_changed_callback, void,(void (*fn)(void)));
 /* menu.c */
 P(rootmenu,struct menu,);
 
-P(menu_is_visible,bool,(struct menu *menu));
+P(menu_is_visible, bool, (struct menu *menu));
+P(menu_has_prompt, bool, (struct menu *menu));
 P(menu_get_prompt,const char *,(struct menu *menu));
 P(menu_get_root_menu,struct menu *,(struct menu *menu));
 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
 P(menu_has_help,bool,(struct menu *menu));
 P(menu_get_help,const char *,(struct menu *menu));
-P(get_symbol_str,void,(struct gstr *r, struct symbol *sym));
+P(get_symbol_str, void, (struct gstr *r, struct symbol *sym));
+P(get_relations_str, struct gstr, (struct symbol **sym_arr));
 P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));
 
 /* symbol.c */
index 616c60138183c8c9b74c3f2562f7e4a1e5b6d5d9..dd8e587c50e26eada18fe35995aaa0ec301f42fc 100644 (file)
@@ -180,7 +180,7 @@ do_resize:
                case KEY_LEFT:
                        switch (button) {
                        case -1:
-                               button = 1;     /* Indicates "Cancel" button is selected */
+                               button = 1;     /* Indicates "Help" button is selected */
                                print_buttons(dialog, height, width, 1);
                                break;
                        case 0:
@@ -204,7 +204,7 @@ do_resize:
                                print_buttons(dialog, height, width, 0);
                                break;
                        case 0:
-                               button = 1;     /* Indicates "Cancel" button is selected */
+                               button = 1;     /* Indicates "Help" button is selected */
                                print_buttons(dialog, height, width, 1);
                                break;
                        case 1:
index fa9d633f293c7c3a107b956e15774afd27560b12..1d604738fa1314a3479362082208b3591385d890 100644 (file)
@@ -383,6 +383,10 @@ do_resize:
                case 'n':
                case 'm':
                case '/':
+               case 'h':
+               case '?':
+               case 'z':
+               case '\n':
                        /* save scroll info */
                        *s_scroll = scroll;
                        delwin(menu);
@@ -390,8 +394,10 @@ do_resize:
                        item_set(scroll + choice);
                        item_set_selected(1);
                        switch (key) {
+                       case 'h':
+                       case '?':
+                               return 2;
                        case 's':
-                               return 3;
                        case 'y':
                                return 3;
                        case 'n':
@@ -402,18 +408,12 @@ do_resize:
                                return 6;
                        case '/':
                                return 7;
+                       case 'z':
+                               return 8;
+                       case '\n':
+                               return button;
                        }
                        return 0;
-               case 'h':
-               case '?':
-                       button = 2;
-               case '\n':
-                       *s_scroll = scroll;
-                       delwin(menu);
-                       delwin(dialog);
-                       item_set(scroll + choice);
-                       item_set_selected(1);
-                       return button;
                case 'e':
                case 'x':
                        key = KEY_ESC;
index a9f9aa3df05dba1a152058933943d744fa1d95fb..b64368ea249aad1b2ab99076599707471de99402 100644 (file)
@@ -70,13 +70,15 @@ static const char mconf_readme[] = N_(
 "             there is a delayed response which you may find annoying.\n"
 "\n"
 "   Also, the <TAB> and cursor keys will cycle between <Select>,\n"
-"   <Exit> and <Help>\n"
+"   <Exit> and <Help>.\n"
 "\n"
 "o  To get help with an item, use the cursor keys to highlight <Help>\n"
-"   and Press <ENTER>.\n"
+"   and press <ENTER>.\n"
 "\n"
 "   Shortcut: Press <H> or <?>.\n"
 "\n"
+"o  To show hidden options, press <Z>.\n"
+"\n"
 "\n"
 "Radiolists  (Choice lists)\n"
 "-----------\n"
@@ -275,6 +277,7 @@ static int indent;
 static struct menu *current_menu;
 static int child_count;
 static int single_menu_mode;
+static int show_all_options;
 
 static void conf(struct menu *menu);
 static void conf_choice(struct menu *menu);
@@ -285,19 +288,6 @@ static void show_textbox(const char *title, const char *text, int r, int c);
 static void show_helptext(const char *title, const char *text);
 static void show_help(struct menu *menu);
 
-static struct gstr get_relations_str(struct symbol **sym_arr)
-{
-       struct symbol *sym;
-       struct gstr res = str_new();
-       int i;
-
-       for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
-               get_symbol_str(&res, sym);
-       if (!i)
-               str_append(&res, _("No matches found.\n"));
-       return res;
-}
-
 static char filename[PATH_MAX+1];
 static void set_config_filename(const char *config_filename)
 {
@@ -362,8 +352,16 @@ static void build_conf(struct menu *menu)
        int type, tmp, doint = 2;
        tristate val;
        char ch;
-
-       if (!menu_is_visible(menu))
+       bool visible;
+
+       /*
+        * note: menu_is_visible() has side effect that it will
+        * recalc the value of the symbol.
+        */
+       visible = menu_is_visible(menu);
+       if (show_all_options && !menu_has_prompt(menu))
+               return;
+       else if (!show_all_options && !visible)
                return;
 
        sym = menu->sym;
@@ -622,6 +620,9 @@ static void conf(struct menu *menu)
                case 7:
                        search_conf();
                        break;
+               case 8:
+                       show_all_options = !show_all_options;
+                       break;
                }
        }
 }
@@ -641,6 +642,7 @@ static void show_help(struct menu *menu)
 {
        struct gstr help = str_new();
 
+       help.max_width = getmaxx(stdscr) - 10;
        menu_get_ext_help(menu, &help);
 
        show_helptext(_(menu_get_prompt(menu)), str_get(&help));
index 059a2465c5744ffed6d3cff25e2d8135a16c0399..203632cc30bdbe12ad0644c3aff15ed07a4e7c0d 100644 (file)
@@ -38,7 +38,7 @@ static void prop_warn(struct property *prop, const char *fmt, ...)
        va_end(ap);
 }
 
-void menu_init(void)
+void _menu_init(void)
 {
        current_entry = current_menu = &rootmenu;
        last_entry_ptr = &rootmenu.list;
@@ -197,7 +197,7 @@ static void sym_check_prop(struct symbol *sym)
                        if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
                            prop->expr->type != E_SYMBOL)
                                prop_warn(prop,
-                                   "default for config symbol '%'"
+                                   "default for config symbol '%s'"
                                    " must be a single symbol", sym->name);
                        break;
                case P_SELECT:
@@ -390,6 +390,13 @@ void menu_finalize(struct menu *parent)
        }
 }
 
+bool menu_has_prompt(struct menu *menu)
+{
+       if (!menu->prompt)
+               return false;
+       return true;
+}
+
 bool menu_is_visible(struct menu *menu)
 {
        struct menu *child;
@@ -398,6 +405,7 @@ bool menu_is_visible(struct menu *menu)
 
        if (!menu->prompt)
                return false;
+
        sym = menu->sym;
        if (sym) {
                sym_calc_value(sym);
@@ -407,12 +415,14 @@ bool menu_is_visible(struct menu *menu)
 
        if (visible != no)
                return true;
+
        if (!sym || sym_get_tristate_value(menu->sym) == no)
                return false;
 
        for (child = menu->list; child; child = child->next)
                if (menu_is_visible(child))
                        return true;
+
        return false;
 }
 
@@ -515,6 +525,20 @@ void get_symbol_str(struct gstr *r, struct symbol *sym)
        str_append(r, "\n\n");
 }
 
+struct gstr get_relations_str(struct symbol **sym_arr)
+{
+       struct symbol *sym;
+       struct gstr res = str_new();
+       int i;
+
+       for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
+               get_symbol_str(&res, sym);
+       if (!i)
+               str_append(&res, _("No matches found.\n"));
+       return res;
+}
+
+
 void menu_get_ext_help(struct menu *menu, struct gstr *help)
 {
        struct symbol *sym = menu->sym;
index 6c8fbbb66ebcaddefff183696d1c5d89bc2d6c09..2e7a048e0cfceb32970d4d0a6fa8b211d70ef83e 100644 (file)
@@ -651,12 +651,20 @@ bool sym_is_changable(struct symbol *sym)
        return sym->visible > sym->rev_dep.tri;
 }
 
+static unsigned strhash(const char *s)
+{
+       /* fnv32 hash */
+       unsigned hash = 2166136261U;
+       for (; *s; s++)
+               hash = (hash ^ *s) * 0x01000193;
+       return hash;
+}
+
 struct symbol *sym_lookup(const char *name, int flags)
 {
        struct symbol *symbol;
-       const char *ptr;
        char *new_name;
-       int hash = 0;
+       int hash;
 
        if (name) {
                if (name[0] && !name[1]) {
@@ -666,12 +674,11 @@ struct symbol *sym_lookup(const char *name, int flags)
                        case 'n': return &symbol_no;
                        }
                }
-               for (ptr = name; *ptr; ptr++)
-                       hash += *ptr;
-               hash &= 0xff;
+               hash = strhash(name) % SYMBOL_HASHSIZE;
 
                for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
-                       if (!strcmp(symbol->name, name) &&
+                       if (symbol->name &&
+                           !strcmp(symbol->name, name) &&
                            (flags ? symbol->flags & flags
                                   : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
                                return symbol;
@@ -679,7 +686,7 @@ struct symbol *sym_lookup(const char *name, int flags)
                new_name = strdup(name);
        } else {
                new_name = NULL;
-               hash = 256;
+               hash = 0;
        }
 
        symbol = malloc(sizeof(*symbol));
@@ -697,7 +704,6 @@ struct symbol *sym_lookup(const char *name, int flags)
 struct symbol *sym_find(const char *name)
 {
        struct symbol *symbol = NULL;
-       const char *ptr;
        int hash = 0;
 
        if (!name)
@@ -710,12 +716,11 @@ struct symbol *sym_find(const char *name)
                case 'n': return &symbol_no;
                }
        }
-       for (ptr = name; *ptr; ptr++)
-               hash += *ptr;
-       hash &= 0xff;
+       hash = strhash(name) % SYMBOL_HASHSIZE;
 
        for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
-               if (!strcmp(symbol->name, name) &&
+               if (symbol->name &&
+                   !strcmp(symbol->name, name) &&
                    !(symbol->flags & SYMBOL_CONST))
                                break;
        }
@@ -750,6 +755,7 @@ struct symbol **sym_re_search(const char *pattern)
                                return NULL;
                        }
                }
+               sym_calc_value(sym);
                sym_arr[cnt++] = sym;
        }
        if (sym_arr)
index b6b2a46af14c400b556b61c3f6e1caeed792a87a..78b5c04e736bcfad3f25d7f85fe2b5660572cb52 100644 (file)
@@ -72,12 +72,13 @@ int file_write_dep(const char *name)
 }
 
 
-/* Allocate initial growable sting */
+/* Allocate initial growable string */
 struct gstr str_new(void)
 {
        struct gstr gs;
        gs.s = malloc(sizeof(char) * 64);
        gs.len = 64;
+       gs.max_width = 0;
        strcpy(gs.s, "\0");
        return gs;
 }
@@ -88,6 +89,7 @@ struct gstr str_assign(const char *s)
        struct gstr gs;
        gs.s = strdup(s);
        gs.len = strlen(s) + 1;
+       gs.max_width = 0;
        return gs;
 }
 
index de9aeba1a61d011589491eaf87a95adc3070ab63..6d540d2b04de914fd94cd1b03657facd2fcec4f2 100644 (file)
@@ -104,7 +104,7 @@ static void zconf_error(const char *err, ...);
 static void zconferror(const char *err);
 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
 
-struct symbol *symbol_hash[257];
+struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 
 static struct menu *current_menu, *current_entry;
 
@@ -2220,7 +2220,7 @@ void conf_parse(const char *name)
        zconf_initscan(name);
 
        sym_init();
-       menu_init();
+       _menu_init();
        modules_sym = sym_lookup(NULL, 0);
        modules_sym->type = S_BOOLEAN;
        modules_sym->flags |= SYMBOL_AUTO;
@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu)
        struct property *prop;
 
        if (sym_is_choice(sym))
-               fprintf(out, "choice\n");
+               fprintf(out, "\nchoice\n");
        else
-               fprintf(out, "config %s\n", sym->name);
+               fprintf(out, "\nconfig %s\n", sym->name);
        switch (sym->type) {
        case S_BOOLEAN:
                fputs("  boolean\n", out);
@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu)
                case P_CHOICE:
                        fputs("  #choice value\n", out);
                        break;
+               case P_SELECT:
+                       fputs( "  select ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_RANGE:
+                       fputs( "  range ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_MENU:
+                       fputs( "  menu ", out);
+                       print_quoted_string(out, prop->text);
+                       fputc('\n', out);
+                       break;
                default:
                        fprintf(out, "  unknown prop %d!\n", prop->type);
                        break;
@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu)
                        menu->help[len] = 0;
                fprintf(out, "  help\n%s\n", menu->help);
        }
-       fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out)
                                expr_fprint(prop->visible.expr, out);
                                fputc('\n', out);
                        }
-                       fputs("\n", out);
                }
 
                if (menu->list)
index 8c43491f8cc9635cde61b9f80a98598a77948d75..23dfd3baa7a1ba906c80a0df0383fbfcf8979bad 100644 (file)
@@ -27,7 +27,7 @@ static void zconf_error(const char *err, ...);
 static void zconferror(const char *err);
 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
 
-struct symbol *symbol_hash[257];
+struct symbol *symbol_hash[SYMBOL_HASHSIZE];
 
 static struct menu *current_menu, *current_entry;
 
@@ -475,7 +475,7 @@ void conf_parse(const char *name)
        zconf_initscan(name);
 
        sym_init();
-       menu_init();
+       _menu_init();
        modules_sym = sym_lookup(NULL, 0);
        modules_sym->type = S_BOOLEAN;
        modules_sym->flags |= SYMBOL_AUTO;
@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu)
        struct property *prop;
 
        if (sym_is_choice(sym))
-               fprintf(out, "choice\n");
+               fprintf(out, "\nchoice\n");
        else
-               fprintf(out, "config %s\n", sym->name);
+               fprintf(out, "\nconfig %s\n", sym->name);
        switch (sym->type) {
        case S_BOOLEAN:
                fputs("  boolean\n", out);
@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu)
                case P_CHOICE:
                        fputs("  #choice value\n", out);
                        break;
+               case P_SELECT:
+                       fputs( "  select ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_RANGE:
+                       fputs( "  range ", out);
+                       expr_fprint(prop->expr, out);
+                       fputc('\n', out);
+                       break;
+               case P_MENU:
+                       fputs( "  menu ", out);
+                       print_quoted_string(out, prop->text);
+                       fputc('\n', out);
+                       break;
                default:
                        fprintf(out, "  unknown prop %d!\n", prop->type);
                        break;
@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu)
                        menu->help[len] = 0;
                fprintf(out, "  help\n%s\n", menu->help);
        }
-       fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -683,7 +697,6 @@ void zconfdump(FILE *out)
                                expr_fprint(prop->visible.expr, out);
                                fputc('\n', out);
                        }
-                       fputs("\n", out);
                }
 
                if (menu->list)