From c02bb3e0b72cd17aaa3cdfb9587d934f1097cc1f Mon Sep 17 00:00:00 2001 From: l4check Date: Tue, 29 Jan 2013 07:12:37 +0000 Subject: [PATCH] update git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@44 d050ee49-bd90-4346-b210-929a50b99cfc --- kernel/fiasco/src/Makerules.VERSION | 25 +- kernel/fiasco/src/drivers/io.cpp | 6 +- kernel/fiasco/src/jdb/jdb_tbuf_show.cpp | 50 +- .../fiasco/src/kern/arm/bsp/imx/uart-imx.cpp | 2 +- .../bsp/integrator/uart-arm-integrator.cpp | 2 +- .../bsp/realview/mem_layout-arm-realview.cpp | 2 +- .../arm/bsp/realview/uart-arm-realview.cpp | 2 +- kernel/fiasco/src/kern/arm/fpu-arm.cpp | 2 +- kernel/fiasco/src/kern/arm/timer-arm.cpp | 23 +- kernel/fiasco/src/kern/config.cpp | 2 +- kernel/fiasco/src/kern/context.cpp | 4 +- kernel/fiasco/src/kern/ia32/apic-ia32-mp.cpp | 11 + kernel/fiasco/src/kern/ia32/vm_svm.cpp | 18 +- kernel/fiasco/src/kern/ia32/vm_vmx.cpp | 18 +- kernel/fiasco/src/kern/ipc_timeout.cpp | 5 +- kernel/fiasco/src/kern/kernel_uart.cpp | 2 +- kernel/fiasco/src/kern/platform_control.cpp | 15 +- kernel/fiasco/src/lib/uart/uart_pl011.cc | 18 +- kernel/fiasco/src/lib/uart/uart_pl011.h | 4 + kernel/fiasco/tool/kconfig/Makefile | 123 +- kernel/fiasco/tool/kconfig/README | 2 +- .../tool/kconfig/scripts/Kbuild.include | 14 +- kernel/fiasco/tool/kconfig/scripts/Makefile | 2 + .../tool/kconfig/scripts/Makefile.build | 11 + .../tool/kconfig/scripts/Makefile.headersinst | 52 +- .../tool/kconfig/scripts/Makefile.modinst | 5 +- .../tool/kconfig/scripts/Makefile.modpost | 2 +- .../tool/kconfig/scripts/basic/.gitignore | 1 + .../tool/kconfig/scripts/kconfig/.gitignore | 1 - .../tool/kconfig/scripts/kconfig/Makefile | 51 +- .../tool/kconfig/scripts/kconfig/check.sh | 2 +- .../tool/kconfig/scripts/kconfig/conf.c | 25 +- .../tool/kconfig/scripts/kconfig/confdata.c | 61 +- .../tool/kconfig/scripts/kconfig/expr.h | 10 + .../tool/kconfig/scripts/kconfig/list.h | 91 + .../tool/kconfig/scripts/kconfig/lkc_proto.h | 6 +- .../kconfig/lxdialog/check-lxdialog.sh | 10 +- .../kconfig/scripts/kconfig/lxdialog/dialog.h | 9 +- .../scripts/kconfig/lxdialog/textbox.c | 174 +- .../kconfig/scripts/kconfig/lxdialog/util.c | 7 + .../tool/kconfig/scripts/kconfig/mconf.c | 129 +- .../tool/kconfig/scripts/kconfig/menu.c | 55 +- .../tool/kconfig/scripts/kconfig/nconf.c | 12 +- .../tool/kconfig/scripts/kconfig/nconf.gui.c | 8 +- .../scripts/kconfig/zconf.tab.c_shipped | 2 +- kernel/fiasco/tool/preprocess/src/preprocess | 9 +- kernel/fiasco/tool/preprocess/test/Makefile | 2 +- .../preprocess/test/implement_template.cpp | 31 + .../test/verify/implement_template.cc | 5 + .../test/verify/implement_template.h | 58 + .../test/verify/implement_template_i.h | 6 + .../tool/preprocess/test/verify/line_nh.h | 1 + .../tool/preprocess/test/verify/line_not.cc | 1 + .../tool/preprocess/test/verify/line_not.h | 1 + .../tool/preprocess/test/verify/operator.h | 4 + .../tool/preprocess/test/verify/template.cc | 10 - .../tool/preprocess/test/verify/template.h | 17 +- l4/Makefile | 8 +- l4/mk/defconfig/config.arm-rv | 3 + l4/pkg/bootstrap/server/src/Make.rules | 2 +- .../server/src/platform/integrator.cc | 2 +- l4/pkg/bootstrap/server/src/platform/rv.cc | 2 +- .../server/src/platform/rv_vexpress.cc | 2 +- l4/pkg/drivers-frst/uart/include/uart_pl011.h | 4 + l4/pkg/drivers-frst/uart/src/uart_pl011.cc | 18 +- l4/pkg/examples/sys/vmtest/svmtest.c | 27 +- l4/pkg/io/config/x86-legacy.devs | 1 + l4/pkg/io/server/libpciids/src/pci.ids | 971 ++- l4/pkg/io/server/src/Make.rules | 6 +- l4/pkg/io/server/src/Makefile | 2 +- l4/pkg/l4sys/include/__vm-svm.h | 3 +- l4/pkg/l4util/lib/src/Makefile | 2 +- l4/pkg/libio-io/lib/src/io.cc | 3 + l4/pkg/libstdc++-headers/include-std/Makefile | 2 +- l4/pkg/libvcpu/include/vcpu | 10 +- l4/pkg/libvcpu/include/vcpu.h | 17 +- l4/pkg/libvcpu/lib/src/ARCH-amd64/arch.cc | 5 +- l4/pkg/libvcpu/lib/src/ARCH-x86/arch.cc | 1 - l4/pkg/libvcpu/lib/src/vcpu.cc | 5 +- l4/pkg/mag-gfx/include/gfx_colors | 1 + l4/pkg/mag/server/src/screen.cc | 1 + l4/pkg/moe/server/src/alloc.cc | 4 +- l4/pkg/moe/server/src/quota.h | 11 +- l4/pkg/plr/Control | 4 +- l4/pkg/plr/Makefile | 2 +- l4/pkg/plr/doc/romain.lua | 4 +- l4/pkg/plr/doc/threadini.sh | 27 +- l4/pkg/plr/ex/Makefile | 6 +- l4/pkg/plr/ex/eventbuf/Makefile | 20 + l4/pkg/plr/ex/eventbuf/main.cc | 61 + l4/pkg/plr/ex/hello/Makefile | 15 + l4/pkg/plr/ex/hello/cmain.c | 27 + l4/pkg/plr/ex/hello/main.cc | 37 + l4/pkg/plr/ex/pthread_hello/main.c | 1 + l4/pkg/plr/ex/pthread_mutex/Makefile | 1 + l4/pkg/plr/ex/pthread_mutex/main.c | 44 +- l4/pkg/plr/include/measurements.h | 225 + l4/pkg/plr/include/pthread_rep.h | 25 +- l4/pkg/plr/include/uu.h | 29 + l4/pkg/plr/lib/Makefile | 2 +- l4/pkg/plr/lib/libevbuf_c/Makefile | 15 + l4/pkg/plr/lib/libevbuf_c/eb.cc | 12 + l4/pkg/plr/lib/libpthread_romain/src/Makefile | 6 +- l4/pkg/plr/lib/libpthread_romain/src/descr.h | 238 + l4/pkg/plr/lib/libpthread_romain/src/mutex.c | 396 +- l4/pkg/plr/lib/libuu/Makefile | 15 + l4/pkg/plr/lib/libuu/uu.c | 271 + l4/pkg/plr/patches/fiasco_ud2yield.diff | 69 + l4/pkg/plr/patches/l4sys_kdebug0x42.diff | 72 + l4/pkg/plr/server/src/Makefile | 4 +- l4/pkg/plr/server/src/app | 7 +- l4/pkg/plr/server/src/app_loading | 2 +- l4/pkg/plr/server/src/app_loading.cc | 10 +- l4/pkg/plr/server/src/app_thread.cc | 4 +- l4/pkg/plr/server/src/configuration | 6 +- l4/pkg/plr/server/src/constants.h | 18 +- l4/pkg/plr/server/src/emulation | 2 +- l4/pkg/plr/server/src/emulation.cc | 2 +- l4/pkg/plr/server/src/exceptions | 6 +- .../plr/server/src/fault_handlers/debugger.cc | 2 +- .../plr/server/src/fault_handlers/debugging.h | 2 +- .../plr/server/src/fault_handlers/kiptime.cc | 2 +- .../src/fault_handlers/lock_observer.cc | 97 +- .../server/src/fault_handlers/lock_observer.h | 67 +- .../plr/server/src/fault_handlers/observer.cc | 3 +- .../plr/server/src/fault_handlers/observers.h | 19 +- .../server/src/fault_handlers/pagefault.cc | 12 + .../server/src/fault_handlers/replicalog.cc | 166 + l4/pkg/plr/server/src/fault_handlers/swifi.h | 2 +- .../plr/server/src/fault_handlers/syscalls.cc | 24 +- .../src/fault_handlers/syscalls_factory.h | 4 +- .../src/fault_handlers/syscalls_handler.h | 2 +- .../server/src/fault_handlers/trap_limit.cc | 2 +- .../src/fault_handlers/trap_observer.cc | 2 +- l4/pkg/plr/server/src/fault_observers | 4 +- l4/pkg/plr/server/src/gdb_stub/connection | 2 +- l4/pkg/plr/server/src/gdb_stub/gdb.cc | 2 +- l4/pkg/plr/server/src/gdb_stub/gdbserver | 2 +- .../server/src/gdb_stub/serial_connection.cc | 2 +- .../plr/server/src/gdb_stub/tcp_connection.cc | 2 +- l4/pkg/plr/server/src/handler.cc | 35 +- l4/pkg/plr/server/src/locking.h | 2 +- l4/pkg/plr/server/src/log | 4 +- l4/pkg/plr/server/src/logging.cc | 56 + l4/pkg/plr/server/src/main.cc | 10 +- l4/pkg/plr/server/src/manager | 9 +- l4/pkg/plr/server/src/manager.cc | 141 +- l4/pkg/plr/server/src/memory | 62 +- l4/pkg/plr/server/src/memory.cc | 15 +- l4/pkg/plr/server/src/redundancy.h | 2 +- l4/pkg/plr/server/src/redundancy/dmr.cc | 10 +- l4/pkg/plr/server/src/thread_group.h | 10 +- l4/pkg/plr/tools/boris/boris | 7 + l4/pkg/plr/tools/igor/igor | 7 + l4/pkg/plr/tools/timur/timur | 7 + l4/pkg/plr/tools/tsar/tsar | 267 + l4/pkg/plr/tools/tsar/tsar_events.py | 162 + l4/pkg/serial-drv/server/src/main.cc | 2 +- l4/pkg/sqlite/lib/README | 7 +- l4/pkg/sqlite/lib/contrib/Makefile.am | 2 +- l4/pkg/sqlite/lib/contrib/Makefile.in | 524 +- l4/pkg/sqlite/lib/contrib/configure | 20 +- l4/pkg/sqlite/lib/contrib/configure.ac | 2 +- l4/pkg/sqlite/lib/contrib/shell.c | 150 +- l4/pkg/sqlite/lib/contrib/sqlite3.c | 6487 ++++++++++------- l4/pkg/sqlite/lib/contrib/sqlite3.h | 71 +- l4/pkg/uclibc/lib/libpthread/src/Makefile | 2 +- l4/pkg/uclibc/lib/libpthread/src/signals.c | 34 + .../uclibc/ARCH-all/include/bits/sigthread.h | 12 + .../src/valgrind-3.6.0-svn/Makefile.in | 2 +- l4/tool/kconfig/Makefile | 123 +- l4/tool/kconfig/README | 2 +- l4/tool/kconfig/scripts/Kbuild.include | 14 +- l4/tool/kconfig/scripts/Makefile | 2 + l4/tool/kconfig/scripts/Makefile.build | 11 + l4/tool/kconfig/scripts/Makefile.headersinst | 52 +- l4/tool/kconfig/scripts/Makefile.modinst | 5 +- l4/tool/kconfig/scripts/Makefile.modpost | 2 +- l4/tool/kconfig/scripts/kconfig/.gitignore | 1 - l4/tool/kconfig/scripts/kconfig/Makefile | 51 +- l4/tool/kconfig/scripts/kconfig/check.sh | 2 +- l4/tool/kconfig/scripts/kconfig/conf.c | 25 +- l4/tool/kconfig/scripts/kconfig/confdata.c | 61 +- l4/tool/kconfig/scripts/kconfig/expr.h | 10 + l4/tool/kconfig/scripts/kconfig/list.h | 91 + l4/tool/kconfig/scripts/kconfig/lkc_proto.h | 6 +- .../kconfig/lxdialog/check-lxdialog.sh | 10 +- .../kconfig/scripts/kconfig/lxdialog/dialog.h | 9 +- .../scripts/kconfig/lxdialog/textbox.c | 174 +- .../kconfig/scripts/kconfig/lxdialog/util.c | 7 + l4/tool/kconfig/scripts/kconfig/mconf.c | 129 +- l4/tool/kconfig/scripts/kconfig/menu.c | 55 +- l4/tool/kconfig/scripts/kconfig/nconf.c | 12 +- l4/tool/kconfig/scripts/kconfig/nconf.gui.c | 8 +- tools/preprocess/src/preprocess | 47 +- tools/preprocess/test/Makefile | 2 +- tools/preprocess/test/implement_template.cpp | 31 + .../test/verify/implement_template.cc | 5 + .../test/verify/implement_template.h | 58 + .../test/verify/implement_template_i.h | 6 + tools/preprocess/test/verify/line_nh.h | 1 + tools/preprocess/test/verify/line_not.cc | 1 + tools/preprocess/test/verify/line_not.h | 1 + tools/preprocess/test/verify/operator.h | 4 + tools/preprocess/test/verify/template.cc | 10 - tools/preprocess/test/verify/template.h | 17 +- 206 files changed, 9342 insertions(+), 4263 deletions(-) create mode 100644 kernel/fiasco/tool/kconfig/scripts/basic/.gitignore create mode 100644 kernel/fiasco/tool/kconfig/scripts/kconfig/list.h create mode 100644 kernel/fiasco/tool/preprocess/test/implement_template.cpp create mode 100644 kernel/fiasco/tool/preprocess/test/verify/implement_template.cc create mode 100644 kernel/fiasco/tool/preprocess/test/verify/implement_template.h create mode 100644 kernel/fiasco/tool/preprocess/test/verify/implement_template_i.h create mode 100644 l4/pkg/plr/ex/eventbuf/Makefile create mode 100644 l4/pkg/plr/ex/eventbuf/main.cc create mode 100644 l4/pkg/plr/ex/hello/Makefile create mode 100644 l4/pkg/plr/ex/hello/cmain.c create mode 100644 l4/pkg/plr/ex/hello/main.cc create mode 100644 l4/pkg/plr/include/measurements.h create mode 100644 l4/pkg/plr/include/uu.h create mode 100644 l4/pkg/plr/lib/libevbuf_c/Makefile create mode 100644 l4/pkg/plr/lib/libevbuf_c/eb.cc create mode 100644 l4/pkg/plr/lib/libpthread_romain/src/descr.h create mode 100644 l4/pkg/plr/lib/libuu/Makefile create mode 100644 l4/pkg/plr/lib/libuu/uu.c create mode 100644 l4/pkg/plr/patches/fiasco_ud2yield.diff create mode 100644 l4/pkg/plr/patches/l4sys_kdebug0x42.diff create mode 100644 l4/pkg/plr/server/src/fault_handlers/replicalog.cc create mode 100644 l4/pkg/plr/server/src/logging.cc create mode 100755 l4/pkg/plr/tools/tsar/tsar create mode 100644 l4/pkg/plr/tools/tsar/tsar_events.py create mode 100644 l4/pkg/uclibc/lib/libpthread/src/signals.c create mode 100644 l4/tool/kconfig/scripts/kconfig/list.h create mode 100644 tools/preprocess/test/implement_template.cpp create mode 100644 tools/preprocess/test/verify/implement_template.cc create mode 100644 tools/preprocess/test/verify/implement_template.h create mode 100644 tools/preprocess/test/verify/implement_template_i.h diff --git a/kernel/fiasco/src/Makerules.VERSION b/kernel/fiasco/src/Makerules.VERSION index 3922d3f59..cbfe5f92f 100644 --- a/kernel/fiasco/src/Makerules.VERSION +++ b/kernel/fiasco/src/Makerules.VERSION @@ -6,18 +6,19 @@ $(filter kip%.o,$(OBJ_ABI)): $(VERSION) $(VERSION): FORCE $(GENVER_MESSAGE) - $(VERBOSE)if [ -d $(srcdir)/.svn ]; then \ - v=`svnversion -nc $(srcdir)`; v=$${v%[A-Z]}; \ - echo "#define CODE_VERSION \"r$${v#*:}\"" > $@; \ - elif [ -d $(srcdir)/.git ]; then \ - v=`git rev-parse --verify --short HEAD 2>/dev/null` \ - echo "#define CODE_VERSION \"$$v\"" > $@; \ - elif [ -d $(srcdir)/.hg ]; then \ - v=`hg id 2>/dev/null` \ - echo "#define CODE_VERSION \"$${v% *}\"" > $@; \ - else \ - echo "#define CODE_VERSION \"UNKNOWN\"" > $@; \ - fi + $(VERBOSE)v=`git rev-parse --verify --short HEAD 2>/dev/null`;\ + if [ -z "$$v" ]; then \ + v=`svnversion -nc $(srcdir)`; \ + if [ -n "$$v" ]; then \ + v=$${v%[A-Z]}; v="r$${v#*:}"; \ + else \ + v=`hg id 2>/dev/null`; \ + if [ -n "$$v" ]; then \ + v="$${v% *}"; \ + fi \ + fi \ + fi; \ + echo "#define CODE_VERSION \"$$v\"" > $@ $(VERBOSE)echo "#define BUILD_DATE \"$$(date)\"" >> $@ $(VERBOSE)if [ -e .build_nr ]; then \ nr=$$(($$(cat .build_nr) + 1)); \ diff --git a/kernel/fiasco/src/drivers/io.cpp b/kernel/fiasco/src/drivers/io.cpp index e1a0685ad..412bdb5ab 100644 --- a/kernel/fiasco/src/drivers/io.cpp +++ b/kernel/fiasco/src/drivers/io.cpp @@ -127,17 +127,17 @@ IMPLEMENTATION: IMPLEMENT inline template< typename T> void Io::mask(T mask, Address address) -{ write(read(address) & mask, address); } +{ write(read(address) & mask, address); } IMPLEMENT inline template< typename T> void Io::clear(T clearbits, Address address) -{ write(read(address) & ~clearbits, address); } +{ write(read(address) & ~clearbits, address); } IMPLEMENT inline template< typename T> void Io::set(T setbits, Address address) -{ write(read(address) | setbits, address); } +{ write(read(address) | setbits, address); } diff --git a/kernel/fiasco/src/jdb/jdb_tbuf_show.cpp b/kernel/fiasco/src/jdb/jdb_tbuf_show.cpp index d88ef390a..d91c4a952 100644 --- a/kernel/fiasco/src/jdb/jdb_tbuf_show.cpp +++ b/kernel/fiasco/src/jdb/jdb_tbuf_show.cpp @@ -782,33 +782,37 @@ restart: { typedef Tb_entry::Group_order Group_order; - Tb_entry const *ce = Jdb_tbuf::lookup(_absy + addy); - Tb_entry_formatter const *fmt = Tb_entry_formatter::get_fmt(ce); Group_order pt; + Tb_entry const *ce = Jdb_tbuf::lookup(_absy + addy); - if (fmt) - pt = fmt->has_partner(ce); - - if (!pt.not_grouped()) + if (ce) { - if (!pt.is_first()) - find_group(&group, ce, true, lines, pt.depth()); - if (!pt.is_last()) - find_group(&group, ce, false, lines, pt.depth()); - } + Tb_entry_formatter const *fmt = Tb_entry_formatter::get_fmt(ce); - for (unsigned i = 0; i < group.size(); ++i) - { - Entry_group::Item const &item = group[i]; - Jdb::cursor(item.y - _absy + Tbuf_start_line, 3); - putstr(Jdb::esc_emph); - if (item.order.is_first()) - putstr("<++"); - else if (item.order.is_last()) - putstr("++>"); - else if (item.order.grouped()) - putstr("+++"); - putstr("\033[m"); + if (fmt) + pt = fmt->has_partner(ce); + + if (!pt.not_grouped()) + { + if (!pt.is_first()) + find_group(&group, ce, true, lines, pt.depth()); + if (!pt.is_last()) + find_group(&group, ce, false, lines, pt.depth()); + } + + for (unsigned i = 0; i < group.size(); ++i) + { + Entry_group::Item const &item = group[i]; + Jdb::cursor(item.y - _absy + Tbuf_start_line, 3); + putstr(Jdb::esc_emph); + if (item.order.is_first()) + putstr("<++"); + else if (item.order.is_last()) + putstr("++>"); + else if (item.order.grouped()) + putstr("+++"); + putstr("\033[m"); + } } } diff --git a/kernel/fiasco/src/kern/arm/bsp/imx/uart-imx.cpp b/kernel/fiasco/src/kern/arm/bsp/imx/uart-imx.cpp index 67d7041d1..7f6e572f8 100644 --- a/kernel/fiasco/src/kern/arm/bsp/imx/uart-imx.cpp +++ b/kernel/fiasco/src/kern/arm/bsp/imx/uart-imx.cpp @@ -41,7 +41,7 @@ IMPLEMENTATION [imx6]: #include "uart_imx.h" -IMPLEMENT int Uart::irq() const { return 90; } +IMPLEMENT int Uart::irq() const { return 59; } IMPLEMENT L4::Uart *Uart::uart() { diff --git a/kernel/fiasco/src/kern/arm/bsp/integrator/uart-arm-integrator.cpp b/kernel/fiasco/src/kern/arm/bsp/integrator/uart-arm-integrator.cpp index 78a837bdd..dbef46c80 100644 --- a/kernel/fiasco/src/kern/arm/bsp/integrator/uart-arm-integrator.cpp +++ b/kernel/fiasco/src/kern/arm/bsp/integrator/uart-arm-integrator.cpp @@ -9,6 +9,6 @@ IMPLEMENT int Uart::irq() const { return 1; } IMPLEMENT L4::Uart *Uart::uart() { - static L4::Uart_pl011 uart; + static L4::Uart_pl011 uart(24019200); return &uart; } diff --git a/kernel/fiasco/src/kern/arm/bsp/realview/mem_layout-arm-realview.cpp b/kernel/fiasco/src/kern/arm/bsp/realview/mem_layout-arm-realview.cpp index b7af3315b..d33d22446 100644 --- a/kernel/fiasco/src/kern/arm/bsp/realview/mem_layout-arm-realview.cpp +++ b/kernel/fiasco/src/kern/arm/bsp/realview/mem_layout-arm-realview.cpp @@ -79,7 +79,7 @@ public: }; enum Phys_layout_realview_mp : Address { - Devices1_phys_base = 0x1f000000, + Devices1_phys_base = 0x10100000, Devices2_phys_base = Invalid_address, }; }; diff --git a/kernel/fiasco/src/kern/arm/bsp/realview/uart-arm-realview.cpp b/kernel/fiasco/src/kern/arm/bsp/realview/uart-arm-realview.cpp index 9572d7444..bd85d5648 100644 --- a/kernel/fiasco/src/kern/arm/bsp/realview/uart-arm-realview.cpp +++ b/kernel/fiasco/src/kern/arm/bsp/realview/uart-arm-realview.cpp @@ -19,6 +19,6 @@ IMPLEMENT Address Uart::base() const { return Mem_layout::Uart_base; } IMPLEMENT L4::Uart *Uart::uart() { - static L4::Uart_pl011 uart; + static L4::Uart_pl011 uart(24019200); return &uart; } diff --git a/kernel/fiasco/src/kern/arm/fpu-arm.cpp b/kernel/fiasco/src/kern/arm/fpu-arm.cpp index 70ffc63be..b221b76cf 100644 --- a/kernel/fiasco/src/kern/arm/fpu-arm.cpp +++ b/kernel/fiasco/src/kern/arm/fpu-arm.cpp @@ -77,7 +77,7 @@ Fpu::copro_enable() "orr %0, %0, %1 \n" "mcr p15, 0, %0, c1, c0, 2\n" : : "r" (0), "I" (0x00f00000)); - Mem::dsb(); + Mem::isb(); } // ------------------------------------------------------------------------ diff --git a/kernel/fiasco/src/kern/arm/timer-arm.cpp b/kernel/fiasco/src/kern/arm/timer-arm.cpp index 685038d43..9a03120d6 100644 --- a/kernel/fiasco/src/kern/arm/timer-arm.cpp +++ b/kernel/fiasco/src/kern/arm/timer-arm.cpp @@ -9,6 +9,26 @@ private: static inline void update_one_shot(Unsigned64 wakeup); }; +// ------------------------------------------------------------------------ +IMPLEMENTATION [arm && vcache]: + +#include "mem_unit.h" + +PRIVATE static inline NEEDS["mem_unit.h"] +void +Timer::kipclock_cache() +{ + Mem_unit::clean_dcache((void *)&Kip::k()->clock); +} + +// ------------------------------------------------------------------------ +IMPLEMENTATION [arm && !vcache]: + +PRIVATE static inline +void +Timer::kipclock_cache() +{} + // ------------------------------------------------------------------------ IMPLEMENTATION [arm]: @@ -24,13 +44,14 @@ Timer::init_system_clock() Kip::k()->clock = 0; } -IMPLEMENT inline NEEDS["config.h", "globals.h", "kip.h", "watchdog.h"] +IMPLEMENT inline NEEDS["config.h", "globals.h", "kip.h", "watchdog.h", Timer::kipclock_cache] void Timer::update_system_clock(unsigned cpu) { if (cpu == 0) { Kip::k()->clock += Config::Scheduler_granularity; + kipclock_cache(); Watchdog::touch(); } } diff --git a/kernel/fiasco/src/kern/config.cpp b/kernel/fiasco/src/kern/config.cpp index 9d0d17d92..15d125c57 100644 --- a/kernel/fiasco/src/kern/config.cpp +++ b/kernel/fiasco/src/kern/config.cpp @@ -142,7 +142,7 @@ INTERFACE: #define CONFIG_KERNEL_VERSION_STRING \ GREETING_COLOR_ANSI_TITLE "Welcome to Fiasco.OC (" CONFIG_XARCH ")!\\n" \ GREETING_COLOR_ANSI_INFO "L4/Fiasco.OC " ARCH_NAME " " \ - "microkernel (C) 1998-2012 TU Dresden\\n" \ + "microkernel (C) 1998-2013 TU Dresden\\n" \ "Rev: " CODE_VERSION " compiled with gcc " COMPILER \ " for " TARGET_NAME " [" CONFIG_LABEL "]\\n" \ "Build: #" BUILD_NR " " BUILD_DATE "\\n" \ diff --git a/kernel/fiasco/src/kern/context.cpp b/kernel/fiasco/src/kern/context.cpp index a364e66a8..d78c1bc3d 100644 --- a/kernel/fiasco/src/kern/context.cpp +++ b/kernel/fiasco/src/kern/context.cpp @@ -317,11 +317,13 @@ protected: Migration *_migration; bool _need_to_finish_migration; +public: void arch_load_vcpu_kern_state(Vcpu_state *vcpu, bool do_load); + +protected: void arch_load_vcpu_user_state(Vcpu_state *vcpu, bool do_load); void arch_update_vcpu_state(Vcpu_state *vcpu); -protected: // XXX Timeout for both, sender and receiver! In normal case we would have // to define own timeouts in Receiver and Sender but because only one // timeout can be set at one time we use the same timeout. The timeout diff --git a/kernel/fiasco/src/kern/ia32/apic-ia32-mp.cpp b/kernel/fiasco/src/kern/ia32/apic-ia32-mp.cpp index 42ca49cbf..ddfcb98ac 100644 --- a/kernel/fiasco/src/kern/ia32/apic-ia32-mp.cpp +++ b/kernel/fiasco/src/kern/ia32/apic-ia32-mp.cpp @@ -61,6 +61,15 @@ Apic::mp_ipi_idle_timeout(Cpu const *c, Unsigned32 wait) return mp_ipi_idle(); } +PRIVATE static inline +void +Apic::delay(Cpu const *c, Unsigned32 wait) +{ + Unsigned64 wait_till = c->time_us() + wait; + while (c->time_us() < wait_till) + Proc::pause(); +} + PUBLIC static inline NEEDS [] void Apic::mp_send_ipi(Unsigned32 dest, Unsigned32 vect, @@ -133,6 +142,8 @@ Apic::mp_startup(Cpu const *current_cpu, Unsigned32 dest, Address tramp_page) // Send INIT IPI mp_send_ipi(dest, 0, APIC_IPI_INIT); + delay(current_cpu, 200); + // delay for 10ms (=10,000us) if (!mp_ipi_idle_timeout(current_cpu, 10000)) return; diff --git a/kernel/fiasco/src/kern/ia32/vm_svm.cpp b/kernel/fiasco/src/kern/ia32/vm_svm.cpp index e16066513..f89770bdb 100644 --- a/kernel/fiasco/src/kern/ia32/vm_svm.cpp +++ b/kernel/fiasco/src/kern/ia32/vm_svm.cpp @@ -667,7 +667,10 @@ Vm_svm::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) assert_kdb (user_mode); if (EXPECT_FALSE(!(ctxt->state(true) & Thread_ext_vcpu_enabled))) - return -L4_err::EInval; + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + return -L4_err::EInval; + } Vmcb *vmcb_s = reinterpret_cast(reinterpret_cast(vcpu) + 0x400); for (;;) @@ -678,6 +681,7 @@ Vm_svm::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) && (vcpu->sticky_flags & Vcpu_state::Sf_irq_pending)) { vmcb_s->control_area.exitcode = 0x60; + ctxt->arch_load_vcpu_kern_state(vcpu, true); return 1; // return 1 to indicate pending IRQs (IPCs) } @@ -685,7 +689,10 @@ Vm_svm::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) // test for error or non-IRQ exit reason if (r <= 0) - return r; + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + return r; + } // check for IRQ exits and allow to handle the IRQ if (r == 1) @@ -699,8 +706,11 @@ Vm_svm::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) Thread *t = nonull_static_cast(ctxt); if (t->continuation_test_and_restore()) - t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp, - t->vcpu_state().usr().get()); + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp, + t->vcpu_state().usr().get()); + } } } diff --git a/kernel/fiasco/src/kern/ia32/vm_vmx.cpp b/kernel/fiasco/src/kern/ia32/vm_vmx.cpp index 6d8ebd6d5..586a4a381 100644 --- a/kernel/fiasco/src/kern/ia32/vm_vmx.cpp +++ b/kernel/fiasco/src/kern/ia32/vm_vmx.cpp @@ -481,7 +481,10 @@ Vm_vmx::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) assert_kdb (user_mode); if (EXPECT_FALSE(!(ctxt->state(true) & Thread_ext_vcpu_enabled))) - return -L4_err::EInval; + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + return -L4_err::EInval; + } void *vmcs_s = reinterpret_cast(vcpu) + 0x400; @@ -494,6 +497,7 @@ Vm_vmx::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) { // XXX: check if this is correct, we set external irq exit as reason write(vmcs_s, Vmx::F_exit_reason, 1); + ctxt->arch_load_vcpu_kern_state(vcpu, true); return 1; // return 1 to indicate pending IRQs (IPCs) } @@ -501,7 +505,10 @@ Vm_vmx::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) // test for error or non-IRQ exit reason if (r <= 0) - return r; + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + return r; + } // check for IRQ exits and allow to handle the IRQ if (r == 1) @@ -514,7 +521,10 @@ Vm_vmx::resume_vcpu(Context *ctxt, Vcpu_state *vcpu, bool user_mode) // with bogus state. Thread *t = nonull_static_cast(ctxt); if (t->continuation_test_and_restore()) - t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp, - t->vcpu_state().usr().get()); + { + ctxt->arch_load_vcpu_kern_state(vcpu, true); + t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp, + t->vcpu_state().usr().get()); + } } } diff --git a/kernel/fiasco/src/kern/ipc_timeout.cpp b/kernel/fiasco/src/kern/ipc_timeout.cpp index 08c20701e..9a382bb3a 100644 --- a/kernel/fiasco/src/kern/ipc_timeout.cpp +++ b/kernel/fiasco/src/kern/ipc_timeout.cpp @@ -55,7 +55,10 @@ IPC_timeout::expired() { Receiver * const _owner = owner(); - // Set thread ready + Mword ipc_state = _owner->state() & Thread_ipc_mask; + if (!ipc_state || (ipc_state & Thread_receive_in_progress)) + return false; + _owner->state_change_dirty(~Thread_ipc_mask, Thread_ready | Thread_timeout); // Flag reschedule if owner's priority is higher than the current diff --git a/kernel/fiasco/src/kern/kernel_uart.cpp b/kernel/fiasco/src/kern/kernel_uart.cpp index ce086afba..0d5732392 100644 --- a/kernel/fiasco/src/kern/kernel_uart.cpp +++ b/kernel/fiasco/src/kern/kernel_uart.cpp @@ -108,9 +108,9 @@ public: { mask_and_ack(); ui->ack(); + unmask(); if (!Vkey::check_()) kdb_ke("IRQ ENTRY"); - unmask(); } }; diff --git a/kernel/fiasco/src/kern/platform_control.cpp b/kernel/fiasco/src/kern/platform_control.cpp index 339ac82db..978016037 100644 --- a/kernel/fiasco/src/kern/platform_control.cpp +++ b/kernel/fiasco/src/kern/platform_control.cpp @@ -20,6 +20,16 @@ void Platform_control::init(unsigned) {} +IMPLEMENT inline NEEDS["l4_types.h"] +int +Platform_control::system_suspend() +{ return -L4_err::EBusy; } + +// ------------------------------------------------------------------------ +IMPLEMENTATION [!cpu_suspend || !mp]: + +#include "l4_types.h" + IMPLEMENT inline bool Platform_control::cpu_offline_available() @@ -34,8 +44,3 @@ IMPLEMENT inline NEEDS["l4_types.h"] int Platform_control::resume_cpu(unsigned) { return -L4_err::ENodev; } - -IMPLEMENT inline NEEDS["l4_types.h"] -int -Platform_control::system_suspend() -{ return -L4_err::EBusy; } diff --git a/kernel/fiasco/src/lib/uart/uart_pl011.cc b/kernel/fiasco/src/lib/uart/uart_pl011.cc index 34174a4a2..02e8500c9 100644 --- a/kernel/fiasco/src/lib/uart/uart_pl011.cc +++ b/kernel/fiasco/src/lib/uart/uart_pl011.cc @@ -41,16 +41,18 @@ namespace L4 UART011_IMSC = 0x38, UART011_MIS = 0x40, UART011_ICR = 0x44, - }; + Default_baud = 115200, + }; bool Uart_pl011::startup(Io_register_block const *regs) { _regs = regs; _regs->write(UART011_CR, UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_RXE); - _regs->write(UART011_FBRD, 2); - _regs->write(UART011_IBRD, 13); - _regs->write(UART011_LCRH, 0x60); + unsigned fi_val = _freq * 4 / Default_baud; + _regs->write(UART011_FBRD, fi_val & 0x3f); + _regs->write(UART011_IBRD, fi_val >> 6); + _regs->write(UART011_LCRH, UART01x_LCRH_WLEN_8); _regs->write(UART011_IMSC, 0); Poll_timeout_counter i(3000000); while (i.test() && _regs->read(UART01x_FR) & UART01x_FR_BUSY) @@ -80,14 +82,12 @@ namespace L4 bool Uart_pl011::change_mode(Transfer_mode, Baud_rate r) { - if (r != 115200) - return false; - unsigned long old_cr = _regs->read(UART011_CR); _regs->write(UART011_CR, 0); - _regs->write(UART011_FBRD, 2); - _regs->write(UART011_IBRD, 13); + unsigned fi_val = _freq * 4 / r; + _regs->write(UART011_FBRD, fi_val & 0x3f); + _regs->write(UART011_IBRD, fi_val >> 6); _regs->write(UART011_LCRH, UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN); _regs->write(UART011_CR, old_cr); diff --git a/kernel/fiasco/src/lib/uart/uart_pl011.h b/kernel/fiasco/src/lib/uart/uart_pl011.h index 3e9019ea6..9d5322f11 100644 --- a/kernel/fiasco/src/lib/uart/uart_pl011.h +++ b/kernel/fiasco/src/lib/uart/uart_pl011.h @@ -8,6 +8,7 @@ namespace L4 class Uart_pl011 : public Uart { public: + Uart_pl011(unsigned freq) : _freq(freq) {} bool startup(Io_register_block const *); void shutdown(); bool change_mode(Transfer_mode m, Baud_rate r); @@ -16,6 +17,9 @@ namespace L4 int char_avail() const; inline void out_char(char c) const; int write(char const *s, unsigned long count) const; + + private: + unsigned _freq; }; }; diff --git a/kernel/fiasco/tool/kconfig/Makefile b/kernel/fiasco/tool/kconfig/Makefile index c565ae059..cc8a266ff 100644 --- a/kernel/fiasco/tool/kconfig/Makefile +++ b/kernel/fiasco/tool/kconfig/Makefile @@ -1,8 +1,8 @@ VERSION = 3 -PATCHLEVEL = 5 +PATCHLEVEL = 7 SUBLEVEL = 0 EXTRAVERSION = -NAME = Saber-toothed Squirrel +NAME = Terrified Chipmunk # *DOCUMENTATION* # To see a list of typical targets execute "make help" @@ -350,12 +350,22 @@ AFLAGS_KERNEL = CFLAGS_GCOV = -fprofile-arcs -ftest-coverage +# Use USERINCLUDE when you must reference the UAPI directories only. +USERINCLUDE := \ + -I$(srctree)/arch/$(hdr-arch)/include/uapi \ + -Iarch/$(hdr-arch)/include/generated/uapi \ + -I$(srctree)/include/uapi \ + -Iinclude/generated/uapi \ + -include $(srctree)/include/linux/kconfig.h + # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option -LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \ - -Iarch/$(hdr-arch)/include/generated -Iinclude \ - $(if $(KBUILD_SRC), -I$(srctree)/include) \ - -include $(srctree)/include/linux/kconfig.h +LINUXINCLUDE := \ + -I$(srctree)/arch/$(hdr-arch)/include \ + -Iarch/$(hdr-arch)/include/generated \ + $(if $(KBUILD_SRC), -I$(srctree)/include) \ + -Iinclude \ + $(USERINCLUDE) KBUILD_CPPFLAGS := -D__KERNEL__ @@ -427,7 +437,9 @@ endif PHONY += asm-generic asm-generic: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ - obj=arch/$(SRCARCH)/include/generated/asm + src=asm obj=arch/$(SRCARCH)/include/generated/asm + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ + src=uapi/asm obj=arch/$(SRCARCH)/include/generated/uapi/asm # To make sure we do not include .config for any of the *config targets # catch them early, and hand them over to scripts/kconfig/Makefile @@ -437,9 +449,11 @@ asm-generic: # Detect when mixed targets is specified, and make a second invocation # of make so .config is not included in this case either (for *config). +version_h := include/generated/uapi/linux/version.h + no-dot-config-targets := clean mrproper distclean \ cscope gtags TAGS tags help %docs check% coccicheck \ - include/linux/version.h headers_% archheaders archscripts \ + $(version_h) headers_% archheaders archscripts \ kernelversion %src-pkg config-targets := 0 @@ -535,11 +549,11 @@ PHONY += include/config/auto.conf include/config/auto.conf: $(Q)test -e include/generated/autoconf.h -a -e $@ || ( \ - echo; \ - echo " ERROR: Kernel configuration is invalid."; \ - echo " include/generated/autoconf.h or $@ are missing.";\ - echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ - echo; \ + echo >&2; \ + echo >&2 " ERROR: Kernel configuration is invalid."; \ + echo >&2 " include/generated/autoconf.h or $@ are missing.";\ + echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ + echo >&2 ; \ /bin/false) endif # KBUILD_EXTMOD @@ -609,7 +623,11 @@ KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) endif ifdef CONFIG_FUNCTION_TRACER -KBUILD_CFLAGS += -pg +ifdef CONFIG_HAVE_FENTRY +CC_USING_FENTRY := $(call cc-option, -mfentry -DCC_USING_FENTRY) +endif +KBUILD_CFLAGS += -pg $(CC_USING_FENTRY) +KBUILD_AFLAGS += $(CC_USING_FENTRY) ifdef CONFIG_DYNAMIC_FTRACE ifdef CONFIG_HAVE_C_RECORDMCOUNT BUILD_C_RECORDMCOUNT := y @@ -648,22 +666,9 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y) endif # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments -# But warn user when we do so -warn-assign = \ -$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)") - -ifneq ($(KCPPFLAGS),) - $(call warn-assign,CPPFLAGS) - KBUILD_CPPFLAGS += $(KCPPFLAGS) -endif -ifneq ($(KAFLAGS),) - $(call warn-assign,AFLAGS) - KBUILD_AFLAGS += $(KAFLAGS) -endif -ifneq ($(KCFLAGS),) - $(call warn-assign,CFLAGS) - KBUILD_CFLAGS += $(KCFLAGS) -endif +KBUILD_CPPFLAGS += $(KCPPFLAGS) +KBUILD_AFLAGS += $(KAFLAGS) +KBUILD_CFLAGS += $(KCFLAGS) # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ @@ -714,6 +719,17 @@ endif # INSTALL_MOD_STRIP export mod_strip_cmd +ifeq ($(CONFIG_MODULE_SIG),y) +MODSECKEY = ./signing_key.priv +MODPUBKEY = ./signing_key.x509 +export MODPUBKEY +mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY) +else +mod_sign_cmd = true +endif +export mod_sign_cmd + + ifeq ($(KBUILD_EXTMOD),) core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ @@ -796,8 +812,8 @@ prepare3: include/config/kernel.release ifneq ($(KBUILD_SRC),) @$(kecho) ' Using $(srctree) as source for kernel' $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \ - echo " $(srctree) is not clean, please run 'make mrproper'"; \ - echo " in the '$(srctree)' directory.";\ + echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \ + echo >&2 " in the '$(srctree)' directory.";\ /bin/false; \ fi; endif @@ -805,7 +821,7 @@ endif # prepare2 creates a makefile if using a separate output directory prepare2: prepare3 outputmakefile asm-generic -prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \ +prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ include/config/auto.conf $(cmd_crmodverdir) @@ -838,7 +854,7 @@ define filechk_version.h echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) endef -include/linux/version.h: $(srctree)/Makefile FORCE +$(version_h): $(srctree)/Makefile FORCE $(call filechk,version.h) include/generated/utsrelease.h: include/config/kernel.release FORCE @@ -883,7 +899,7 @@ PHONY += archscripts archscripts: PHONY += __headers -__headers: include/linux/version.h scripts_basic asm-generic archheaders archscripts FORCE +__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE $(Q)$(MAKE) $(build)=scripts build_unifdef PHONY += headers_install_all @@ -892,10 +908,10 @@ headers_install_all: PHONY += headers_install headers_install: __headers - $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \ - $(error Headers not exportable for the $(SRCARCH) architecture)) - $(Q)$(MAKE) $(hdr-inst)=include - $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) + $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \ + $(error Headers not exportable for the $(SRCARCH) architecture)) + $(Q)$(MAKE) $(hdr-inst)=include/uapi + $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) PHONY += headers_check_all headers_check_all: headers_install_all @@ -903,8 +919,8 @@ headers_check_all: headers_install_all PHONY += headers_check headers_check: headers_install - $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 - $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1 + $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 + $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 # --------------------------------------------------------------------------- # Modules @@ -971,11 +987,11 @@ else # CONFIG_MODULES # --------------------------------------------------------------------------- modules modules_install: FORCE - @echo - @echo "The present kernel configuration has modules disabled." - @echo "Type 'make config' and enable loadable module support." - @echo "Then build a kernel with module support enabled." - @echo + @echo >&2 + @echo >&2 "The present kernel configuration has modules disabled." + @echo >&2 "Type 'make config' and enable loadable module support." + @echo >&2 "Then build a kernel with module support enabled." + @echo >&2 @exit 1 endif # CONFIG_MODULES @@ -993,9 +1009,11 @@ CLEAN_DIRS += $(MODVERDIR) # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config usr/include include/generated \ arch/*/include/generated -MRPROPER_FILES += .config .config.old .version .old_version \ - include/linux/version.h \ - Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS +MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ + Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ + signing_key.priv signing_key.x509 x509.genkey \ + extra_certificates signing_key.x509.keyid \ + signing_key.x509.signer # clean - Delete most, but leave enough to build external modules # @@ -1239,6 +1257,7 @@ clean: $(clean-dirs) $(call cmd,rmfiles) @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + -o -name '*.ko.*' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ -o -name '*.symtypes' -o -name 'modules.order' \ -o -name modules.builtin -o -name '.tmp_*.o.*' \ @@ -1302,10 +1321,12 @@ kernelversion: # Clear a bunch of variables before executing the submake tools/: FORCE - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ + $(Q)mkdir -p $(objtree)/tools + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ tools/%: FORCE - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= -C $(src)/tools/ $* + $(Q)mkdir -p $(objtree)/tools + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS= O=$(objtree) subdir=tools -C $(src)/tools/ $* # Single targets # --------------------------------------------------------------------------- diff --git a/kernel/fiasco/tool/kconfig/README b/kernel/fiasco/tool/kconfig/README index cebd46b7d..3d87ce199 100644 --- a/kernel/fiasco/tool/kconfig/README +++ b/kernel/fiasco/tool/kconfig/README @@ -1,3 +1,3 @@ -kconfig taken from vanilla Linux 3.5, and slightly patched. +kconfig taken from vanilla Linux 3.7, and slightly patched. diff --git a/kernel/fiasco/tool/kconfig/scripts/Kbuild.include b/kernel/fiasco/tool/kconfig/scripts/Kbuild.include index 6a3ee9819..978416dd3 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Kbuild.include +++ b/kernel/fiasco/tool/kconfig/scripts/Kbuild.include @@ -98,24 +98,24 @@ try-run = $(shell set -e; \ # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) as-option = $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2)) + $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) # as-instr # Usage: cflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ - printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) + printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) cc-option = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6) cc-option-yn = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) # cc-option-align # Prefix align with either -falign or -malign @@ -125,7 +125,7 @@ cc-option-align = $(subst -functions=0,,\ # cc-disable-warning # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) cc-disable-warning = $(call try-run,\ - $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -xc /dev/null -o "$$TMP",-Wno-$(strip $(1))) + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) # cc-version # Usage gcc-ver := $(call cc-version) @@ -143,7 +143,7 @@ cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) # cc-ldoption # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) cc-ldoption = $(call try-run,\ - $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) + $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) # ld-option # Usage: LDFLAGS += $(call ld-option, -X) @@ -209,7 +209,7 @@ endif # >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] # in $(cmd_xxx) double $$ your perl vars -make-cmd = $(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))) +make-cmd = $(subst \\,\\\\,$(subst \#,\\\#,$(subst $$,$$$$,$(call escsq,$(cmd_$(1)))))) # Find any prerequisites that is newer than target or that does not exist. # PHONY targets skipped in both cases. diff --git a/kernel/fiasco/tool/kconfig/scripts/Makefile b/kernel/fiasco/tool/kconfig/scripts/Makefile index a55b00677..01e7adb83 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Makefile +++ b/kernel/fiasco/tool/kconfig/scripts/Makefile @@ -16,8 +16,10 @@ hostprogs-$(CONFIG_VT) += conmakehash hostprogs-$(CONFIG_IKCONFIG) += bin2c hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable +hostprogs-$(CONFIG_ASN1) += asn1_compiler HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include +HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include always := $(hostprogs-y) $(hostprogs-m) diff --git a/kernel/fiasco/tool/kconfig/scripts/Makefile.build b/kernel/fiasco/tool/kconfig/scripts/Makefile.build index ff1720d28..0e801c3cd 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Makefile.build +++ b/kernel/fiasco/tool/kconfig/scripts/Makefile.build @@ -354,6 +354,17 @@ quiet_cmd_cpp_lds_S = LDS $@ $(obj)/%.lds: $(src)/%.lds.S FORCE $(call if_changed_dep,cpp_lds_S) +# ASN.1 grammar +# --------------------------------------------------------------------------- +quiet_cmd_asn1_compiler = ASN.1 $@ + cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \ + $(subst .h,.c,$@) $(subst .c,.h,$@) + +.PRECIOUS: $(objtree)/$(obj)/%-asn1.c $(objtree)/$(obj)/%-asn1.h + +$(obj)/%-asn1.c $(obj)/%-asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler + $(call cmd,asn1_compiler) + # Build the compiled-in targets # --------------------------------------------------------------------------- diff --git a/kernel/fiasco/tool/kconfig/scripts/Makefile.headersinst b/kernel/fiasco/tool/kconfig/scripts/Makefile.headersinst index d3bae5e7b..06ba4a70b 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Makefile.headersinst +++ b/kernel/fiasco/tool/kconfig/scripts/Makefile.headersinst @@ -3,13 +3,12 @@ # # header-y - list files to be installed. They are preprocessed # to remove __KERNEL__ section of the file -# objhdr-y - Same as header-y but for generated files -# genhdr-y - Same as objhdr-y but in a generated/ directory +# genhdr-y - Same as header-y but in a generated/ directory # # ========================================================================== # called may set destination dir (when installing to asm/) -_dst := $(if $(dst),$(dst),$(obj)) +_dst := $(or $(destination-y),$(dst),$(obj)) # generated header directory gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) @@ -17,49 +16,64 @@ gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj))) kbuild-file := $(srctree)/$(obj)/Kbuild include $(kbuild-file) -_dst := $(if $(destination-y),$(destination-y),$(_dst)) +old-kbuild-file := $(srctree)/$(subst uapi/,,$(obj))/Kbuild +ifneq ($(wildcard $(old-kbuild-file)),) +include $(old-kbuild-file) +endif include scripts/Kbuild.include -install := $(INSTALL_HDR_PATH)/$(_dst) +installdir := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst)) header-y := $(sort $(header-y)) subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) header-y := $(filter-out %/, $(header-y)) # files used to track state of install/check -install-file := $(install)/.install -check-file := $(install)/.check +install-file := $(installdir)/.install +check-file := $(installdir)/.check # generic-y list all files an architecture uses from asm-generic # Use this to build a list of headers which require a wrapper wrapper-files := $(filter $(header-y), $(generic-y)) +srcdir := $(srctree)/$(obj) +gendir := $(objtree)/$(gen) + +oldsrcdir := $(srctree)/$(subst /uapi,,$(obj)) + # all headers files for this dir header-y := $(filter-out $(generic-y), $(header-y)) -all-files := $(header-y) $(objhdr-y) $(genhdr-y) $(wrapper-files) -input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ - $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) \ - $(addprefix $(objtree)/$(gen)/,$(genhdr-y)) -output-files := $(addprefix $(install)/, $(all-files)) +all-files := $(header-y) $(genhdr-y) $(wrapper-files) +output-files := $(addprefix $(installdir)/, $(all-files)) + +input-files := $(foreach hdr, $(header-y), \ + $(or \ + $(wildcard $(srcdir)/$(hdr)), \ + $(wildcard $(oldsrcdir)/$(hdr)), \ + $(error Missing UAPI file $(srcdir)/$(hdr)) \ + )) \ + $(foreach hdr, $(genhdr-y), \ + $(or \ + $(wildcard $(gendir)/$(hdr)), \ + $(error Missing generated UAPI file $(gendir)/$(hdr)) \ + )) # Work out what needs to be removed -oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h)) +oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) unwanted := $(filter-out $(all-files),$(oldheaders)) # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) -unwanted-file := $(addprefix $(install)/, $(unwanted)) +unwanted-file := $(addprefix $(installdir)/, $(unwanted)) printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ file$(if $(word 2, $(all-files)),s)) cmd_install = \ - $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ - $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ - $(PERL) $< $(objtree)/$(gen) $(install) $(SRCARCH) $(genhdr-y); \ + $(PERL) $< $(installdir) $(SRCARCH) $(input-files); \ for F in $(wrapper-files); do \ - echo "\#include " > $(install)/$$F; \ + echo "\#include " > $(installdir)/$$F; \ done; \ touch $@ @@ -70,7 +84,7 @@ quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) # Headers list can be pretty long, xargs helps to avoid # the "Argument list too long" error. cmd_check = for f in $(all-files); do \ - echo "$(install)/$${f}"; done \ + echo "$(installdir)/$${f}"; done \ | xargs \ $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ touch $@ diff --git a/kernel/fiasco/tool/kconfig/scripts/Makefile.modinst b/kernel/fiasco/tool/kconfig/scripts/Makefile.modinst index efa5d940e..ecbb44797 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Makefile.modinst +++ b/kernel/fiasco/tool/kconfig/scripts/Makefile.modinst @@ -9,15 +9,16 @@ include scripts/Kbuild.include # -__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) +__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o))) PHONY += $(modules) __modinst: $(modules) @: +# Don't stop modules_install if we can't sign external modules. quiet_cmd_modules_install = INSTALL $@ - cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) + cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@) ; $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) # Modules built outside the kernel source tree go into extra by default INSTALL_MOD_DIR ?= extra diff --git a/kernel/fiasco/tool/kconfig/scripts/Makefile.modpost b/kernel/fiasco/tool/kconfig/scripts/Makefile.modpost index 08dce14f2..a1cb0222e 100644 --- a/kernel/fiasco/tool/kconfig/scripts/Makefile.modpost +++ b/kernel/fiasco/tool/kconfig/scripts/Makefile.modpost @@ -60,7 +60,7 @@ kernelsymfile := $(objtree)/Module.symvers modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers # Step 1), find all modules listed in $(MODVERDIR)/ -__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) +__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod))) modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) # Stop after building .o files if NOFINAL is set. Makes compile tests quicker diff --git a/kernel/fiasco/tool/kconfig/scripts/basic/.gitignore b/kernel/fiasco/tool/kconfig/scripts/basic/.gitignore new file mode 100644 index 000000000..a776371a3 --- /dev/null +++ b/kernel/fiasco/tool/kconfig/scripts/basic/.gitignore @@ -0,0 +1 @@ +fixdep diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/.gitignore b/kernel/fiasco/tool/kconfig/scripts/kconfig/.gitignore index ee120d441..be603c4fe 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/.gitignore +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/.gitignore @@ -7,7 +7,6 @@ config* *.tab.h zconf.hash.c *.moc -lkc_defs.h gconf.glade.h *.pot *.mo diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/Makefile b/kernel/fiasco/tool/kconfig/scripts/kconfig/Makefile index 79662658f..3091794e9 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/Makefile +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/Makefile @@ -76,11 +76,17 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf $< --$@ $(Kconfig) -PHONY += listnewconfig oldnoconfig savedefconfig defconfig +PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig -listnewconfig oldnoconfig: $(obj)/conf +listnewconfig olddefconfig: $(obj)/conf $< --$@ $(Kconfig) +# oldnoconfig is an alias of olddefconfig, because people already are dependent +# on its behavior(sets new symbols to their default value but not 'n') with the +# counter-intuitive name. +oldnoconfig: $(obj)/conf + $< --olddefconfig $(Kconfig) + savedefconfig: $(obj)/conf $< --$@=defconfig $(Kconfig) @@ -114,7 +120,7 @@ help: @echo ' alldefconfig - New config with all symbols set to default' @echo ' randconfig - New config with random answer to all options' @echo ' listnewconfig - List new options' - @echo ' oldnoconfig - Same as silentoldconfig but set new symbols to n (unset)' + @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh @@ -234,12 +240,12 @@ $(obj)/.tmp_qtcheck: if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \ done; \ if [ -z "$$dir" ]; then \ - echo "*"; \ - echo "* Unable to find any QT installation. Please make sure that"; \ - echo "* the QT4 or QT3 development package is correctly installed and"; \ - echo "* either qmake can be found or install pkg-config or set"; \ - echo "* the QTDIR environment variable to the correct location."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* Unable to find any QT installation. Please make sure that"; \ + echo >&2 "* the QT4 or QT3 development package is correctly installed and"; \ + echo >&2 "* either qmake can be found or install pkg-config or set"; \ + echo >&2 "* the QTDIR environment variable to the correct location."; \ + echo >&2 "*"; \ false; \ fi; \ libpath=$$dir/lib; lib=qt; osdir=""; \ @@ -260,8 +266,8 @@ $(obj)/.tmp_qtcheck: else \ cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \ libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \ - binpath="\$$(shell pkg-config QtCore --variable=prefix)"; \ - moc="$$binpath/bin/moc"; \ + moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \ + [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \ fi; \ echo "KC_QT_CFLAGS=$$cflags" > $@; \ echo "KC_QT_LIBS=$$libs" >> $@; \ @@ -279,17 +285,17 @@ $(obj)/.tmp_gtkcheck: if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ touch $@; \ else \ - echo "*"; \ - echo "* GTK+ is present but version >= 2.0.0 is required."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* GTK+ is present but version >= 2.0.0 is required."; \ + echo >&2 "*"; \ false; \ fi \ else \ - echo "*"; \ - echo "* Unable to find the GTK+ installation. Please make sure that"; \ - echo "* the GTK+ 2.0 development package is correctly installed..."; \ - echo "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ - echo "*"; \ + echo >&2 "*"; \ + echo >&2 "* Unable to find the GTK+ installation. Please make sure that"; \ + echo >&2 "* the GTK+ 2.0 development package is correctly installed..."; \ + echo >&2 "* You need gtk+-2.0, glib-2.0 and libglade-2.0."; \ + echo >&2 "*"; \ false; \ fi endif @@ -298,8 +304,11 @@ $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c $(obj)/qconf.o: $(obj)/qconf.moc -$(obj)/%.moc: $(src)/%.h - $(KC_QT_MOC) -i $< -o $@ +quiet_cmd_moc = MOC $@ + cmd_moc = $(KC_QT_MOC) -i $< -o $@ + +$(obj)/%.moc: $(src)/%.h $(obj)/.tmp_qtcheck + $(call cmd,moc) # Extract gconf menu items for I18N support $(obj)/gconf.glade.h: $(obj)/gconf.glade diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/check.sh b/kernel/fiasco/tool/kconfig/scripts/kconfig/check.sh index fa59cbf9d..854d9c7c6 100755 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/check.sh +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/check.sh @@ -1,6 +1,6 @@ #!/bin/sh # Needed for systems without gettext -$* -xc -o /dev/null - > /dev/null 2>&1 << EOF +$* -x c -o /dev/null - > /dev/null 2>&1 << EOF #include int main() { diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/conf.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/conf.c index 0dc4a2c77..4da3b4adf 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/conf.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/conf.c @@ -32,7 +32,7 @@ enum input_mode { defconfig, savedefconfig, listnewconfig, - oldnoconfig, + olddefconfig, } input_mode = oldaskconfig; static int indent = 1; @@ -365,7 +365,7 @@ static void conf(struct menu *menu) case P_MENU: if ((input_mode == silentoldconfig || input_mode == listnewconfig || - input_mode == oldnoconfig) && + input_mode == olddefconfig) && rootEntry != menu) { check_conf(menu); return; @@ -429,7 +429,7 @@ static void check_conf(struct menu *menu) if (sym->name && !sym_is_choice_value(sym)) { printf("%s%s\n", CONFIG_, sym->name); } - } else if (input_mode != oldnoconfig) { + } else if (input_mode != olddefconfig) { if (!conf_cnt++) printf(_("*\n* Restart config...\n*\n")); rootEntry = menu_get_parent_menu(menu); @@ -454,7 +454,13 @@ static struct option long_opts[] = { {"alldefconfig", no_argument, NULL, alldefconfig}, {"randconfig", no_argument, NULL, randconfig}, {"listnewconfig", no_argument, NULL, listnewconfig}, - {"oldnoconfig", no_argument, NULL, oldnoconfig}, + {"olddefconfig", no_argument, NULL, olddefconfig}, + /* + * oldnoconfig is an alias of olddefconfig, because people already + * are dependent on its behavior(sets new symbols to their default + * value but not 'n') with the counter-intuitive name. + */ + {"oldnoconfig", no_argument, NULL, olddefconfig}, {NULL, 0, NULL, 0} }; @@ -467,7 +473,8 @@ static void conf_usage(const char *progname) printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); printf(" --oldconfig Update a configuration using a provided .config as base\n"); printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); - printf(" --oldnoconfig Same as silentoldconfig but set new symbols to no\n"); + printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); + printf(" --oldnoconfig An alias of olddefconfig\n"); printf(" --defconfig New config with default defined in \n"); printf(" --savedefconfig Save the minimal current configuration to \n"); printf(" --allnoconfig New config where all options are answered with no\n"); @@ -520,7 +527,7 @@ int main(int ac, char **av) case allmodconfig: case alldefconfig: case listnewconfig: - case oldnoconfig: + case olddefconfig: break; case '?': conf_usage(progname); @@ -565,7 +572,7 @@ int main(int ac, char **av) case oldaskconfig: case oldconfig: case listnewconfig: - case oldnoconfig: + case olddefconfig: conf_read(NULL); break; case allnoconfig: @@ -645,7 +652,7 @@ int main(int ac, char **av) /* fall through */ case oldconfig: case listnewconfig: - case oldnoconfig: + case olddefconfig: case silentoldconfig: /* Update until a loop caused no more changes */ do { @@ -653,7 +660,7 @@ int main(int ac, char **av) check_conf(&rootmenu); } while (conf_cnt && (input_mode != listnewconfig && - input_mode != oldnoconfig)); + input_mode != olddefconfig)); break; } diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/confdata.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/confdata.c index bcc2719d9..13d89e32a 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/confdata.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/confdata.c @@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) return 0; } +#define LINE_GROWTH 16 +static int add_byte(int c, char **lineptr, size_t slen, size_t *n) +{ + char *nline; + size_t new_size = slen + 1; + if (new_size > *n) { + new_size += LINE_GROWTH - 1; + new_size *= 2; + nline = realloc(*lineptr, new_size); + if (!nline) + return -1; + + *lineptr = nline; + *n = new_size; + } + + (*lineptr)[slen] = c; + + return 0; +} + +static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream) +{ + char *line = *lineptr; + size_t slen = 0; + + for (;;) { + int c = getc(stream); + + switch (c) { + case '\n': + if (add_byte(c, &line, slen, n) < 0) + goto e_out; + slen++; + /* fall through */ + case EOF: + if (add_byte('\0', &line, slen, n) < 0) + goto e_out; + *lineptr = line; + if (slen == 0) + return -1; + return slen; + default: + if (add_byte(c, &line, slen, n) < 0) + goto e_out; + slen++; + } + } + +e_out: + line[slen-1] = '\0'; + *lineptr = line; + return -1; +} + int conf_read_simple(const char *name, int def) { FILE *in = NULL; - char line[1024]; + char *line = NULL; + size_t line_asize = 0; char *p, *p2; struct symbol *sym; int i, def_flags; @@ -247,7 +303,7 @@ load: } } - while (fgets(line, sizeof(line), in)) { + while (compat_getline(&line, &line_asize, in) != -1) { conf_lineno++; sym = NULL; if (line[0] == '#') { @@ -335,6 +391,7 @@ setsym: cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); } } + free(line); fclose(in); if (modules_sym) diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/expr.h b/kernel/fiasco/tool/kconfig/scripts/kconfig/expr.h index d4ecce8bc..cdd48600e 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/expr.h +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/expr.h @@ -12,6 +12,7 @@ extern "C" { #include #include +#include "list.h" #ifndef __cplusplus #include #endif @@ -173,6 +174,15 @@ struct menu { #define MENU_CHANGED 0x0001 #define MENU_ROOT 0x0002 +struct jump_key { + struct list_head entries; + size_t offset; + struct menu *target; + int index; +}; + +#define JUMP_NB 9 + extern struct file *file_list; extern struct file *current_file; struct file *lookup_file(const char *name); diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/list.h b/kernel/fiasco/tool/kconfig/scripts/kconfig/list.h new file mode 100644 index 000000000..0ae730be5 --- /dev/null +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/list.h @@ -0,0 +1,91 @@ +#ifndef LIST_H +#define LIST_H + +/* + * Copied from include/linux/... + */ + +#undef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + +/** + * container_of - cast a member of a structure out to the containing structure + * @ptr: the pointer to the member. + * @type: the type of the container struct this is embedded in. + * @member: the name of the member within the struct. + * + */ +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + + +struct list_head { + struct list_head *next, *prev; +}; + + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define LIST_HEAD(name) \ + struct list_head name = LIST_HEAD_INIT(name) + +/** + * list_entry - get the struct for this entry + * @ptr: the &struct list_head pointer. + * @type: the type of the struct this is embedded in. + * @member: the name of the list_struct within the struct. + */ +#define list_entry(ptr, type, member) \ + container_of(ptr, type, member) + +/** + * list_for_each_entry - iterate over list of given type + * @pos: the type * to use as a loop cursor. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + +/** + * list_empty - tests whether a list is empty + * @head: the list to test. + */ +static inline int list_empty(const struct list_head *head) +{ + return head->next == head; +} + +/* + * Insert a new entry between two known consecutive entries. + * + * This is only for internal list manipulation where we know + * the prev/next entries already! + */ +static inline void __list_add(struct list_head *_new, + struct list_head *prev, + struct list_head *next) +{ + next->prev = _new; + _new->next = next; + _new->prev = prev; + prev->next = _new; +} + +/** + * list_add_tail - add a new entry + * @new: new entry to be added + * @head: list head to add it before + * + * Insert a new entry before the specified head. + * This is useful for implementing queues. + */ +static inline void list_add_tail(struct list_head *_new, struct list_head *head) +{ + __list_add(_new, head->prev, head); +} + +#endif diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/lkc_proto.h b/kernel/fiasco/tool/kconfig/scripts/kconfig/lkc_proto.h index 47fe9c340..ef1a7381f 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/lkc_proto.h +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/lkc_proto.h @@ -21,8 +21,10 @@ 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_relations_str, struct gstr, (struct symbol **sym_arr)); +P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct list_head + *head)); +P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct list_head + *head)); P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); /* symbol.c */ diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/check-lxdialog.sh b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/check-lxdialog.sh index 82cc3a85e..c8e8a7154 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -4,7 +4,7 @@ # What library to link ldflags() { - for ext in so a dylib ; do + for ext in so a dll.a dylib ; do for lib in ncursesw ncurses curses ; do $cc -print-file-name=lib${lib}.${ext} | grep -q / if [ $? -eq 0 ]; then @@ -19,12 +19,12 @@ ldflags() # Where is ncurses.h? ccflags() { - if [ -f /usr/include/ncurses/ncurses.h ]; then + if [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' - elif [ -f /usr/include/ncursesw/curses.h ]; then - echo '-I/usr/include/ncursesw -DCURSES_LOC=""' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC=""' else @@ -38,7 +38,7 @@ trap "rm -f $tmp" 0 1 2 3 15 # Check if we can link to ncurses check() { - $cc -xc - -o $tmp 2>/dev/null <<'EOF' + $cc -x c - -o $tmp 2>/dev/null <<'EOF' #include CURSES_LOC main() {} EOF diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/dialog.h b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/dialog.h index b5211fce0..ee17a5264 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/dialog.h +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/dialog.h @@ -144,6 +144,7 @@ struct dialog_info { */ extern struct dialog_info dlg; extern char dialog_input_result[]; +extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */ /* * Function prototypes @@ -209,7 +210,13 @@ int first_alpha(const char *string, const char *exempt); int dialog_yesno(const char *title, const char *prompt, int height, int width); int dialog_msgbox(const char *title, const char *prompt, int height, int width, int pause); -int dialog_textbox(const char *title, const char *file, int height, int width); + + +typedef void (*update_text_fn)(char *buf, size_t start, size_t end, void + *_data); +int dialog_textbox(const char *title, char *tbuf, int initial_height, + int initial_width, int *keys, int *_vscroll, int *_hscroll, + update_text_fn update_text, void *data); int dialog_menu(const char *title, const char *prompt, const void *selected, int *s_scroll); int dialog_checklist(const char *title, const char *prompt, int height, diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/textbox.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/textbox.c index 154c2dd24..a48bb93e0 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/textbox.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/textbox.c @@ -22,23 +22,25 @@ #include "dialog.h" static void back_lines(int n); -static void print_page(WINDOW * win, int height, int width); -static void print_line(WINDOW * win, int row, int width); +static void print_page(WINDOW *win, int height, int width, update_text_fn + update_text, void *data); +static void print_line(WINDOW *win, int row, int width); static char *get_line(void); static void print_position(WINDOW * win); static int hscroll; static int begin_reached, end_reached, page_length; -static const char *buf; -static const char *page; +static char *buf; +static char *page; /* * refresh window content */ static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, - int cur_y, int cur_x) + int cur_y, int cur_x, update_text_fn update_text, + void *data) { - print_page(box, boxh, boxw); + print_page(box, boxh, boxw, update_text, data); print_position(dialog); wmove(dialog, cur_y, cur_x); /* Restore cursor position */ wrefresh(dialog); @@ -47,14 +49,18 @@ static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, /* * Display text from a file in a dialog box. + * + * keys is a null-terminated array + * update_text() may not add or remove any '\n' or '\0' in tbuf */ -int dialog_textbox(const char *title, const char *tbuf, - int initial_height, int initial_width) +int dialog_textbox(const char *title, char *tbuf, int initial_height, + int initial_width, int *keys, int *_vscroll, int *_hscroll, + update_text_fn update_text, void *data) { int i, x, y, cur_x, cur_y, key = 0; int height, width, boxh, boxw; - int passed_end; WINDOW *dialog, *box; + bool done = false; begin_reached = 1; end_reached = 0; @@ -63,6 +69,15 @@ int dialog_textbox(const char *title, const char *tbuf, buf = tbuf; page = buf; /* page is pointer to start of page to be displayed */ + if (_vscroll && *_vscroll) { + begin_reached = 0; + + for (i = 0; i < *_vscroll; i++) + get_line(); + } + if (_hscroll) + hscroll = *_hscroll; + do_resize: getmaxyx(stdscr, height, width); if (height < 8 || width < 8) @@ -120,25 +135,28 @@ do_resize: /* Print first page of text */ attr_clear(box, boxh, boxw, dlg.dialog.atr); - refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x, update_text, + data); - while ((key != KEY_ESC) && (key != '\n')) { + while (!done) { key = wgetch(dialog); switch (key) { case 'E': /* Exit */ case 'e': case 'X': case 'x': - delwin(box); - delwin(dialog); - return 0; + case 'q': + case '\n': + done = true; + break; case 'g': /* First page */ case KEY_HOME: if (!begin_reached) { begin_reached = 1; page = buf; refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + cur_y, cur_x, update_text, + data); } break; case 'G': /* Last page */ @@ -148,78 +166,48 @@ do_resize: /* point to last char in buf */ page = buf + strlen(buf); back_lines(boxh); - refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case 'K': /* Previous line */ case 'k': case KEY_UP: - if (!begin_reached) { - back_lines(page_length + 1); - - /* We don't call print_page() here but use - * scrolling to ensure faster screen update. - * However, 'end_reached' and 'page_length' - * should still be updated, and 'page' should - * point to start of next page. This is done - * by calling get_line() in the following - * 'for' loop. */ - scrollok(box, TRUE); - wscrl(box, -1); /* Scroll box region down one line */ - scrollok(box, FALSE); - page_length = 0; - passed_end = 0; - for (i = 0; i < boxh; i++) { - if (!i) { - /* print first line of page */ - print_line(box, 0, boxw); - wnoutrefresh(box); - } else - /* Called to update 'end_reached' and 'page' */ - get_line(); - if (!passed_end) - page_length++; - if (end_reached && !passed_end) - passed_end = 1; - } + if (begin_reached) + break; - print_position(dialog); - wmove(dialog, cur_y, cur_x); /* Restore cursor position */ - wrefresh(dialog); - } + back_lines(page_length + 1); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case 'B': /* Previous page */ case 'b': + case 'u': case KEY_PPAGE: if (begin_reached) break; back_lines(page_length + boxh); - refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case 'J': /* Next line */ case 'j': case KEY_DOWN: - if (!end_reached) { - begin_reached = 0; - scrollok(box, TRUE); - scroll(box); /* Scroll box region up one line */ - scrollok(box, FALSE); - print_line(box, boxh - 1, boxw); - wnoutrefresh(box); - print_position(dialog); - wmove(dialog, cur_y, cur_x); /* Restore cursor position */ - wrefresh(dialog); - } + if (end_reached) + break; + + back_lines(page_length - 1); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case KEY_NPAGE: /* Next page */ case ' ': + case 'd': if (end_reached) break; begin_reached = 0; - refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case '0': /* Beginning of line */ case 'H': /* Scroll left */ @@ -234,8 +222,8 @@ do_resize: hscroll--; /* Reprint current page to scroll horizontally */ back_lines(page_length); - refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case 'L': /* Scroll right */ case 'l': @@ -245,11 +233,12 @@ do_resize: hscroll++; /* Reprint current page to scroll horizontally */ back_lines(page_length); - refresh_text_box(dialog, box, boxh, boxw, - cur_y, cur_x); + refresh_text_box(dialog, box, boxh, boxw, cur_y, + cur_x, update_text, data); break; case KEY_ESC: - key = on_key_esc(dialog); + if (on_key_esc(dialog) == KEY_ESC) + done = true; break; case KEY_RESIZE: back_lines(height); @@ -257,11 +246,31 @@ do_resize: delwin(dialog); on_key_resize(); goto do_resize; + default: + for (i = 0; keys[i]; i++) { + if (key == keys[i]) { + done = true; + break; + } + } } } delwin(box); delwin(dialog); - return key; /* ESC pressed */ + if (_vscroll) { + const char *s; + + s = buf; + *_vscroll = 0; + back_lines(page_length); + while (s < page && (s = strchr(s, '\n'))) { + (*_vscroll)++; + s++; + } + } + if (_hscroll) + *_hscroll = hscroll; + return key; } /* @@ -298,12 +307,23 @@ static void back_lines(int n) } /* - * Print a new page of text. Called by dialog_textbox(). + * Print a new page of text. */ -static void print_page(WINDOW * win, int height, int width) +static void print_page(WINDOW *win, int height, int width, update_text_fn + update_text, void *data) { int i, passed_end = 0; + if (update_text) { + char *end; + + for (i = 0; i < height; i++) + get_line(); + end = page; + back_lines(height); + update_text(buf, page - buf, end - buf, data); + } + page_length = 0; for (i = 0; i < height; i++) { print_line(win, i, width); @@ -316,7 +336,7 @@ static void print_page(WINDOW * win, int height, int width) } /* - * Print a new line of text. Called by dialog_textbox() and print_page(). + * Print a new line of text. */ static void print_line(WINDOW * win, int row, int width) { @@ -354,10 +374,8 @@ static char *get_line(void) end_reached = 0; while (*page != '\n') { if (*page == '\0') { - if (!end_reached) { - end_reached = 1; - break; - } + end_reached = 1; + break; } else if (i < MAX_LEN) line[i++] = *(page++); else { @@ -370,7 +388,7 @@ static char *get_line(void) if (i <= MAX_LEN) line[i] = '\0'; if (!end_reached) - page++; /* move pass '\n' */ + page++; /* move past '\n' */ return line; } diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/util.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/util.c index f2375ad7e..109d53117 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/util.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/lxdialog/util.c @@ -23,6 +23,9 @@ #include "dialog.h" +/* Needed in signal handler in mconf.c */ +int saved_x, saved_y; + struct dialog_info dlg; static void set_mono_theme(void) @@ -273,6 +276,10 @@ int init_dialog(const char *backtitle) int height, width; initscr(); /* Init curses */ + + /* Get current cursor position for signal handler in mconf.c */ + getyx(stdscr, saved_y, saved_x); + getmaxyx(stdscr, height, width); if (height < 19 || width < 80) { endwin(); diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/mconf.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/mconf.c index f606738d4..53975cf87 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/mconf.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/mconf.c @@ -105,10 +105,10 @@ static const char mconf_readme[] = N_( "Text Box (Help Window)\n" "--------\n" "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" -" keys h,j,k,l function here as do and for those\n" -" who are familiar with less and lynx.\n" +" keys h,j,k,l function here as do , , and for \n" +" those who are familiar with less and lynx.\n" "\n" -"o Press , , or to exit.\n" +"o Press , , , or to exit.\n" "\n" "\n" "Alternate Configuration Files\n" @@ -236,16 +236,19 @@ search_help[] = N_( "Result:\n" "-----------------------------------------------------------------\n" "Symbol: FOO [=m]\n" + "Type : tristate\n" "Prompt: Foo bus is used to drive the bar HW\n" - "Defined at drivers/pci/Kconfig:47\n" - "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" - "Location:\n" - " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" - " -> PCI support (PCI [=y])\n" - " -> PCI access mode ( [=y])\n" - "Selects: LIBCRC32\n" - "Selected by: BAR\n" + " Defined at drivers/pci/Kconfig:47\n" + " Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" + " Location:\n" + " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" + " -> PCI support (PCI [=y])\n" + "(1) -> PCI access mode ( [=y])\n" + " Selects: LIBCRC32\n" + " Selected by: BAR\n" "-----------------------------------------------------------------\n" + "o The line 'Type:' shows the type of the configuration option for\n" + " this symbol (boolean, tristate, string, ...)\n" "o The line 'Prompt:' shows the text used in the menu structure for\n" " this symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n" @@ -254,8 +257,12 @@ search_help[] = N_( " this symbol to be visible in the menu (selectable)\n" "o The 'Location:' lines tell where in the menu structure this symbol\n" " is located\n" - " A location followed by a [=y] indicate that this is a selectable\n" - " menu item - and current value is displayed inside brackets.\n" + " A location followed by a [=y] indicates that this is a\n" + " selectable menu item - and the current value is displayed inside\n" + " brackets.\n" + " Press the key in the (#) prefix to jump directly to that\n" + " location. You will be returned to the current search results\n" + " after exiting this new menu.\n" "o The 'Selects:' line tell what symbol will be automatically\n" " selected if this symbol is selected (y or m)\n" "o The 'Selected by' line tell what symbol has selected this symbol\n" @@ -273,13 +280,15 @@ static struct menu *current_menu; static int child_count; static int single_menu_mode; static int show_all_options; -static int saved_x, saved_y; -static void conf(struct menu *menu); +static void conf(struct menu *menu, struct menu *active_menu); static void conf_choice(struct menu *menu); static void conf_string(struct menu *menu); static void conf_load(void); static void conf_save(void); +static int show_textbox_ext(const char *title, char *text, int r, int c, + int *keys, int *vscroll, int *hscroll, + update_text_fn update_text, void *data); 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); @@ -302,12 +311,47 @@ static void set_config_filename(const char *config_filename) } +struct search_data { + struct list_head *head; + struct menu **targets; + int *keys; +}; + +static void update_text(char *buf, size_t start, size_t end, void *_data) +{ + struct search_data *data = _data; + struct jump_key *pos; + int k = 0; + + list_for_each_entry(pos, data->head, entries) { + if (pos->offset >= start && pos->offset < end) { + char header[4]; + + if (k < JUMP_NB) { + int key = '0' + (pos->index % JUMP_NB) + 1; + + sprintf(header, "(%c)", key); + data->keys[k] = key; + data->targets[k] = pos->target; + k++; + } else { + sprintf(header, " "); + } + + memcpy(buf + pos->offset, header, sizeof(header) - 1); + } + } + data->keys[k] = 0; +} + static void search_conf(void) { struct symbol **sym_arr; struct gstr res; char *dialog_input; - int dres; + int dres, vscroll = 0, hscroll = 0; + bool again; + again: dialog_clear(); dres = dialog_inputbox(_("Search Configuration Parameter"), @@ -330,10 +374,30 @@ again: dialog_input += strlen(CONFIG_); sym_arr = sym_re_search(dialog_input); - res = get_relations_str(sym_arr); + do { + LIST_HEAD(head); + struct menu *targets[JUMP_NB]; + int keys[JUMP_NB + 1], i; + struct search_data data = { + .head = &head, + .targets = targets, + .keys = keys, + }; + + res = get_relations_str(sym_arr, &head); + dres = show_textbox_ext(_("Search Results"), (char *) + str_get(&res), 0, 0, keys, &vscroll, + &hscroll, &update_text, (void *) + &data); + again = false; + for (i = 0; i < JUMP_NB && keys[i]; i++) + if (dres == keys[i]) { + conf(targets[i]->parent, targets[i]); + again = true; + } + str_free(&res); + } while (again); free(sym_arr); - show_textbox(_("Search Results"), str_get(&res), 0, 0); - str_free(&res); } static void build_conf(struct menu *menu) @@ -514,12 +578,11 @@ conf_childs: indent -= doint; } -static void conf(struct menu *menu) +static void conf(struct menu *menu, struct menu *active_menu) { struct menu *submenu; const char *prompt = menu_get_prompt(menu); struct symbol *sym; - struct menu *active_menu = NULL; int res; int s_scroll = 0; @@ -562,13 +625,13 @@ static void conf(struct menu *menu) if (single_menu_mode) submenu->data = (void *) (long) !submenu->data; else - conf(submenu); + conf(submenu, NULL); break; case 't': if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) conf_choice(submenu); else if (submenu->prompt->type == P_MENU) - conf(submenu); + conf(submenu, NULL); break; case 's': conf_string(submenu); @@ -607,7 +670,7 @@ static void conf(struct menu *menu) if (item_is_tag('t')) sym_toggle_tristate_value(sym); else if (item_is_tag('m')) - conf(submenu); + conf(submenu, NULL); break; case 7: search_conf(); @@ -619,10 +682,19 @@ static void conf(struct menu *menu) } } -static void show_textbox(const char *title, const char *text, int r, int c) +static int show_textbox_ext(const char *title, char *text, int r, int c, int + *keys, int *vscroll, int *hscroll, update_text_fn + update_text, void *data) { dialog_clear(); - dialog_textbox(title, text, r, c); + return dialog_textbox(title, text, r, c, keys, vscroll, hscroll, + update_text, data); +} + +static void show_textbox(const char *title, const char *text, int r, int c) +{ + show_textbox_ext(title, (char *) text, r, c, (int []) {0}, NULL, NULL, + NULL, NULL); } static void show_helptext(const char *title, const char *text) @@ -862,9 +934,6 @@ int main(int ac, char **av) single_menu_mode = 1; } - initscr(); - - getyx(stdscr, saved_y, saved_x); if (init_dialog(NULL)) { fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); @@ -873,7 +942,7 @@ int main(int ac, char **av) set_config_filename(conf_get_configname()); do { - conf(&rootmenu); + conf(&rootmenu, NULL); res = handle_exit(); } while (res == KEY_ESC); diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/menu.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/menu.c index 8c2a97e60..e98a05c8e 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/menu.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/menu.c @@ -507,10 +507,12 @@ const char *menu_get_help(struct menu *menu) return ""; } -static void get_prompt_str(struct gstr *r, struct property *prop) +static void get_prompt_str(struct gstr *r, struct property *prop, + struct list_head *head) { int i, j; - struct menu *submenu[8], *menu; + struct menu *submenu[8], *menu, *location = NULL; + struct jump_key *jump; str_printf(r, _("Prompt: %s\n"), _(prop->text)); str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, @@ -521,13 +523,44 @@ static void get_prompt_str(struct gstr *r, struct property *prop) str_append(r, "\n"); } menu = prop->menu->parent; - for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) + for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { + bool accessible = menu_is_visible(menu); + submenu[i++] = menu; + if (location == NULL && accessible) + location = menu; + } + if (head && location) { + jump = malloc(sizeof(struct jump_key)); + + if (menu_is_visible(prop->menu)) { + /* + * There is not enough room to put the hint at the + * beginning of the "Prompt" line. Put the hint on the + * last "Location" line even when it would belong on + * the former. + */ + jump->target = prop->menu; + } else + jump->target = location; + + if (list_empty(head)) + jump->index = 0; + else + jump->index = list_entry(head->prev, struct jump_key, + entries)->index + 1; + + list_add_tail(&jump->entries, head); + } + if (i > 0) { str_printf(r, _(" Location:\n")); for (j = 4; --i >= 0; j += 2) { menu = submenu[i]; - str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); + if (head && location && menu == location) + jump->offset = r->len - 1; + str_printf(r, "%*c-> %s", j, ' ', + _(menu_get_prompt(menu))); if (menu->sym) { str_printf(r, " (%s [=%s])", menu->sym->name ? menu->sym->name : _(""), @@ -538,7 +571,11 @@ static void get_prompt_str(struct gstr *r, struct property *prop) } } -void get_symbol_str(struct gstr *r, struct symbol *sym) +/* + * head is optional and may be NULL + */ +void get_symbol_str(struct gstr *r, struct symbol *sym, + struct list_head *head) { bool hit; struct property *prop; @@ -557,7 +594,7 @@ void get_symbol_str(struct gstr *r, struct symbol *sym) } } for_all_prompts(sym, prop) - get_prompt_str(r, prop); + get_prompt_str(r, prop, head); hit = false; for_all_properties(sym, prop, P_SELECT) { if (!hit) { @@ -577,14 +614,14 @@ 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 gstr get_relations_str(struct symbol **sym_arr, struct list_head *head) { 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); + get_symbol_str(&res, sym, head); if (!i) str_append(&res, _("No matches found.\n")); return res; @@ -603,5 +640,5 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) } str_printf(help, "%s\n", _(help_text)); if (sym) - get_symbol_str(help, sym); + get_symbol_str(help, sym, NULL); } diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.c index 8c0eb6597..87d4b15da 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.c @@ -83,10 +83,10 @@ static const char nconf_readme[] = N_( "Text Box (Help Window)\n" "--------\n" "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" -" keys h,j,k,l function here as do for those\n" -" who are familiar with less and lynx.\n" +" keys h,j,k,l function here as do , and for\n" +" those who are familiar with less and lynx.\n" "\n" -"o Press , , , or to exit.\n" +"o Press , , , , or to exit.\n" "\n" "\n" "Alternate Configuration Files\n" @@ -721,7 +721,7 @@ again: dialog_input += strlen(CONFIG_); sym_arr = sym_re_search(dialog_input); - res = get_relations_str(sym_arr); + res = get_relations_str(sym_arr, NULL); free(sym_arr); show_scroll_win(main_window, _("Search Results"), str_get(&res)); @@ -1503,7 +1503,11 @@ int main(int ac, char **av) } notimeout(stdscr, FALSE); +#if NCURSES_REENTRANT + set_escdelay(1); +#else ESCDELAY = 1; +#endif /* set btns menu */ curses_menu = new_menu(curses_menu_items); diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.gui.c b/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.gui.c index 3b18dd839..379003c7a 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.gui.c +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/nconf.gui.c @@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window, switch (res) { case KEY_NPAGE: case ' ': + case 'd': start_y += text_lines-2; break; case KEY_PPAGE: + case 'u': start_y -= text_lines+2; break; case KEY_HOME: @@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window, start_x++; break; } - if (res == 10 || res == 27 || res == 'q' - || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) { + if (res == 10 || res == 27 || res == 'q' || + res == KEY_F(F_HELP) || res == KEY_F(F_BACK) || + res == KEY_F(F_EXIT)) break; - } if (start_y < 0) start_y = 0; if (start_y >= total_lines-text_lines) diff --git a/kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped b/kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped index d2c56f3c3..f636141e7 100644 --- a/kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped +++ b/kernel/fiasco/tool/kconfig/scripts/kconfig/zconf.tab.c_shipped @@ -2259,7 +2259,7 @@ void conf_parse(const char *name) modules_sym = sym_lookup(NULL, 0); modules_sym->type = S_BOOLEAN; modules_sym->flags |= SYMBOL_AUTO; - rootmenu.prompt = menu_add_prompt(P_MENU, "Fiasco Kernel Configuration", NULL); + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); if (getenv("ZCONF_DEBUG")) zconfdebug = 1; diff --git a/kernel/fiasco/tool/preprocess/src/preprocess b/kernel/fiasco/tool/preprocess/src/preprocess index 0e4d45534..7abbe61de 100755 --- a/kernel/fiasco/tool/preprocess/src/preprocess +++ b/kernel/fiasco/tool/preprocess/src/preprocess @@ -734,7 +734,8 @@ sub parse_file } # Member function definition? - if (/^([^\{\(]*?) # pretext, maybe w template decl tag +# if (/^([^\{\(]*?) # pretext, maybe w template decl tag + if (/^((?:[^\{\(]|\(\()*?) # pretext, maybe w template decl tag \b ($identifier (?: $s :: $s $identifier)*) # class name ($s $template_arg)? # optional class-template args $s :: $s @@ -745,7 +746,7 @@ sub parse_file { my ($pretext, $class, $templateargs, $name, $args, $posttext) = ($1, $2, (defined $3 ? $3 : ''), $4, $5, $6); -#print "P<$pretext> C<$class> T<$templateargs> N<$name> A<$args> P<$posttext>\n"; +#print "Member: P<$pretext> C<$class> T<$templateargs> N<$name> A<$args> P<$posttext>\n"; # Canonify operator names $name =~ s/(?<=\w)(?:$s_once)+(?=\W)//gs; $name =~ s/(?<=\W)(?:$s_once)+(?=\w)//gs; @@ -769,6 +770,7 @@ sub parse_file $s( \( $paren_expr \) [^:\{\(\)=]*) # arg list (\{.*)$/sx) # body { +#print "Free function: $2 T(" . (defined $3 ? $3 : "") . ") PRE($1) ARGS($4) POST($5)\n"; my $function = { class => '', name => $2, templateargs => (defined $3 @@ -869,7 +871,7 @@ sub read_more () # Read one more line of code. Stow away s/\003/$saved/s; } - while (s|(//(?!-\s*\n).*)$|\001$number\001|m) # Do not match magic "//-" + while (s|(//(?!-\s*\n).*\n)|\001$number\001|m) # Do not match magic "//-" { # The \001 signifies whitespace. push @comments, $1; $number++; @@ -1145,7 +1147,6 @@ sub handle_function if ($match =~ /^(?:${s}template$s<${s}>)+${s}$/s); $func->{pretext} =~ s/\Q$match//s; -# $func->{pretext} =~ s|$template[ \t]*||s; next; } diff --git a/kernel/fiasco/tool/preprocess/test/Makefile b/kernel/fiasco/tool/preprocess/test/Makefile index 652866c64..3d48137ab 100644 --- a/kernel/fiasco/tool/preprocess/test/Makefile +++ b/kernel/fiasco/tool/preprocess/test/Makefile @@ -13,7 +13,7 @@ TOOL_TESTS = mapping mapping_inline random random_inline extern_c static \ parser parser_noinline \ multifile variable line line_not line_nh interface comment_in_string \ default_args drop_single1 drop_single2 drop_single3 drop_multi1 \ - drop_multi2 + drop_multi2 implement_template mapping_inline_src = mapping mapping_inline_flags = -i diff --git a/kernel/fiasco/tool/preprocess/test/implement_template.cpp b/kernel/fiasco/tool/preprocess/test/implement_template.cpp new file mode 100644 index 000000000..ae81de0de --- /dev/null +++ b/kernel/fiasco/tool/preprocess/test/implement_template.cpp @@ -0,0 +1,31 @@ +INTERFACE: + +template< typename T > +class Test +{ +public: + void test_func(); +}; + + +IMPLEMENTATION: + +IMPLEMENT +template< typename T > +// comment +void __attribute__((deprecated)) +Test::test_func() +{ +} + +PUBLIC +template< typename T > // comment 1 +template< + typename X, // comment within template args list + typename X2 // another comment in tl args +> +// comment 2 +void __attribute__((deprecated)) +Test::test_func2() +{ +} diff --git a/kernel/fiasco/tool/preprocess/test/verify/implement_template.cc b/kernel/fiasco/tool/preprocess/test/verify/implement_template.cc new file mode 100644 index 000000000..89fa57edc --- /dev/null +++ b/kernel/fiasco/tool/preprocess/test/verify/implement_template.cc @@ -0,0 +1,5 @@ +// AUTOMATICALLY GENERATED -- DO NOT EDIT! -*- c++ -*- + +#include "implement_template.h" +#include "implement_template_i.h" + diff --git a/kernel/fiasco/tool/preprocess/test/verify/implement_template.h b/kernel/fiasco/tool/preprocess/test/verify/implement_template.h new file mode 100644 index 000000000..4cd44334f --- /dev/null +++ b/kernel/fiasco/tool/preprocess/test/verify/implement_template.h @@ -0,0 +1,58 @@ +// AUTOMATICALLY GENERATED -- DO NOT EDIT! -*- c++ -*- + +#ifndef implement_template_h +#define implement_template_h + +// +// INTERFACE definition follows +// + +#line 2 "implement_template.cpp" + +template< typename T > +class Test +{ +public: + void test_func(); + +public: +#line 23 "implement_template.cpp" + // comment 2 + // comment 1 + template< + typename X, // comment within template args list + typename X2 // another comment in tl args + > void __attribute__((deprecated)) + test_func2(); +}; + +// +// IMPLEMENTATION of function templates +// + + +#line 12 "implement_template.cpp" + + + +// comment +template< typename T > void __attribute__((deprecated)) +Test::test_func() +{ +} + +#line 20 "implement_template.cpp" + + + +// comment 2 + // comment 1 +template< typename T > template< + typename X, // comment within template args list + typename X2 // another comment in tl args +> void __attribute__((deprecated)) +Test::test_func2() +{ +} + +#endif // implement_template_h diff --git a/kernel/fiasco/tool/preprocess/test/verify/implement_template_i.h b/kernel/fiasco/tool/preprocess/test/verify/implement_template_i.h new file mode 100644 index 000000000..da19d7d17 --- /dev/null +++ b/kernel/fiasco/tool/preprocess/test/verify/implement_template_i.h @@ -0,0 +1,6 @@ +// AUTOMATICALLY GENERATED -- DO NOT EDIT! -*- c++ -*- + +#ifndef implement_template_i_h +#define implement_template_i_h + +#endif // implement_template_i_h diff --git a/kernel/fiasco/tool/preprocess/test/verify/line_nh.h b/kernel/fiasco/tool/preprocess/test/verify/line_nh.h index bbe70c072..154804e2a 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/line_nh.h +++ b/kernel/fiasco/tool/preprocess/test/verify/line_nh.h @@ -15,6 +15,7 @@ class Foo public: // A long, multiline comment in front of this function definition. // Also, a lot of specifiers that need to be handled. + static void func1(); }; diff --git a/kernel/fiasco/tool/preprocess/test/verify/line_not.cc b/kernel/fiasco/tool/preprocess/test/verify/line_not.cc index eb1d7ca68..ff1bbb81f 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/line_not.cc +++ b/kernel/fiasco/tool/preprocess/test/verify/line_not.cc @@ -8,6 +8,7 @@ // A long, multiline comment in front of this function definition. // Also, a lot of specifiers that need to be handled. + void Foo::func1() { diff --git a/kernel/fiasco/tool/preprocess/test/verify/line_not.h b/kernel/fiasco/tool/preprocess/test/verify/line_not.h index 11ab555d2..f563d556e 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/line_not.h +++ b/kernel/fiasco/tool/preprocess/test/verify/line_not.h @@ -15,6 +15,7 @@ class Foo public: // A long, multiline comment in front of this function definition. // Also, a lot of specifiers that need to be handled. + static void func1(); }; diff --git a/kernel/fiasco/tool/preprocess/test/verify/operator.h b/kernel/fiasco/tool/preprocess/test/verify/operator.h index 1ce3cf4f2..4d63c04e8 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/operator.h +++ b/kernel/fiasco/tool/preprocess/test/verify/operator.h @@ -17,17 +17,21 @@ public: void * operator new(size_t); // funny comment + #line 16 "operator.cpp" Foo& operator+(const Foo&); // funny comment + #line 22 "operator.cpp" Foo& operator=(const Foo&); // funny comment + #line 28 "operator.cpp" Foo& operator*(const Foo&); // funny comment + }; #line 34 "operator.cpp" diff --git a/kernel/fiasco/tool/preprocess/test/verify/template.cc b/kernel/fiasco/tool/preprocess/test/verify/template.cc index 2e60849fa..f3fd7d6be 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/template.cc +++ b/kernel/fiasco/tool/preprocess/test/verify/template.cc @@ -12,13 +12,3 @@ create_stack() { return new stack(); } - -#line 192 "template.cpp" - - - -template <> stack_t* -create_stack() -{ - return new stack(); -} diff --git a/kernel/fiasco/tool/preprocess/test/verify/template.h b/kernel/fiasco/tool/preprocess/test/verify/template.h index 320fceb28..79ab22e2e 100644 --- a/kernel/fiasco/tool/preprocess/test/verify/template.h +++ b/kernel/fiasco/tool/preprocess/test/verify/template.h @@ -109,9 +109,24 @@ template <> stack_t* create_stack(); #line 195 "template.cpp" -template <> stack_t* +template <> inline stack_t* create_stack(); +// +// IMPLEMENTATION of inline functions (and needed classes) +// + + +#line 192 "template.cpp" + + + +template <> inline stack_t* +create_stack() +{ + return new stack(); +} + // // IMPLEMENTATION of function templates // diff --git a/l4/Makefile b/l4/Makefile index 259d6cc71..f8ce99a73 100644 --- a/l4/Makefile +++ b/l4/Makefile @@ -388,9 +388,7 @@ define genimage endef define switch_ram_base_func - echo " ... Regenerating RAM_BASE settings"; \ - echo "# File semi-automatically generated by 'make switch_ram_base'" > $(OBJ_BASE)/Makeconf.ram_base; \ - echo "# Currently being regenerated" >> $(OBJ_BASE)/Makeconf.ram_base; \ + echo " ... Regenerating RAM_BASE settings"; set -e; \ PWD=$(PWD)/pkg/sigma0/server/src $(MAKE) RAM_BASE=$(1) -C pkg/sigma0/server/src; \ PWD=$(PWD)/pkg/moe/server/src $(MAKE) RAM_BASE=$(1) -C pkg/moe/server/src; \ echo "# File semi-automatically generated by 'make switch_ram_base'" > $(OBJ_BASE)/Makeconf.ram_base; \ @@ -411,7 +409,7 @@ check_and_adjust_ram_base: echo "Platform \"$(PLATFORM_TYPE)\" not known."; \ exit 1; \ fi - $(VERBOSE)if [ $$(($(RAM_BASE))) != $$(($(PLATFORM_RAM_BASE))) ]; then \ + $(VERBOSE)if [ $$(($(RAM_BASE))) != $$(($(PLATFORM_RAM_BASE))) -o -z "$(RAM_BASE)" ]; then \ echo "=========== Updating RAM_BASE for platform $(PLATFORM_TYPE) to $(PLATFORM_RAM_BASE) =========" ; \ $(call switch_ram_base_func,$(PLATFORM_RAM_BASE)); \ fi @@ -458,7 +456,7 @@ vbox: $(if $(VBOX_ISOTARGET),$(VBOX_ISOTARGET),grub2iso) echo "Need to set name of configured VirtualBox VM im 'VBOX_VM'."; \ exit 1; \ fi - $(VERBOSE)VBoxSDL \ + $(VERBOSE)VirtualBox \ --startvm $(VBOX_VM) \ --cdrom $(IMAGES_DIR)/.current.iso \ --boot d \ diff --git a/l4/mk/defconfig/config.arm-rv b/l4/mk/defconfig/config.arm-rv index c737cd67c..6ab421af2 100644 --- a/l4/mk/defconfig/config.arm-rv +++ b/l4/mk/defconfig/config.arm-rv @@ -25,14 +25,17 @@ CONFIG_CPU_ARM_ARMV5TE=y # CONFIG_PLATFORM_TYPE_imx21 is not set # CONFIG_PLATFORM_TYPE_imx35 is not set # CONFIG_PLATFORM_TYPE_imx51 is not set +# CONFIG_PLATFORM_TYPE_imx6 is not set # CONFIG_PLATFORM_TYPE_integrator is not set # CONFIG_PLATFORM_TYPE_kirkwood is not set # CONFIG_PLATFORM_TYPE_omap3_am33xx is not set # CONFIG_PLATFORM_TYPE_omap3evm is not set # CONFIG_PLATFORM_TYPE_pandaboard is not set +# CONFIG_PLATFORM_TYPE_rpi_b is not set CONFIG_PLATFORM_TYPE_rv=y # CONFIG_PLATFORM_TYPE_rv_pbx is not set # CONFIG_PLATFORM_TYPE_rv_vexpress is not set +# CONFIG_PLATFORM_TYPE_rv_vexpress_a15 is not set # CONFIG_PLATFORM_TYPE_tegra2 is not set # CONFIG_PLATFORM_TYPE_custom is not set CONFIG_PLATFORM_TYPE="rv" diff --git a/l4/pkg/bootstrap/server/src/Make.rules b/l4/pkg/bootstrap/server/src/Make.rules index 98658136e..746e2cfac 100644 --- a/l4/pkg/bootstrap/server/src/Make.rules +++ b/l4/pkg/bootstrap/server/src/Make.rules @@ -286,7 +286,7 @@ processing-of-module-list-failed: @echo @exit 1 -mod.make.inc: $(GENERAL_D_LOC) $(shell $(call BUILD_MOD_CMD,list)) +mod.make.inc $(od)mbi_modules.bin: $(GENERAL_D_LOC) $(shell $(call BUILD_MOD_CMD,list)) @echo Building entry \""$(ENTRY)"\". $(VERBOSE)$(call BUILD_MOD_CMD,build) diff --git a/l4/pkg/bootstrap/server/src/platform/integrator.cc b/l4/pkg/bootstrap/server/src/platform/integrator.cc index 4521ed8bf..d651e4aa2 100644 --- a/l4/pkg/bootstrap/server/src/platform/integrator.cc +++ b/l4/pkg/bootstrap/server/src/platform/integrator.cc @@ -26,7 +26,7 @@ class Platform_arm_int : public Platform_single_region_ram void init() { static L4::Io_register_block_mmio r(0x16000000); - static L4::Uart_pl011 _uart; + static L4::Uart_pl011 _uart(24019200); _uart.startup(&r); set_stdio_uart(&_uart); } diff --git a/l4/pkg/bootstrap/server/src/platform/rv.cc b/l4/pkg/bootstrap/server/src/platform/rv.cc index ad10986b4..6fcad0b61 100644 --- a/l4/pkg/bootstrap/server/src/platform/rv.cc +++ b/l4/pkg/bootstrap/server/src/platform/rv.cc @@ -27,7 +27,7 @@ class Platform_arm_rv : public Platform_single_region_ram void init() { static L4::Io_register_block_mmio r(0x10009000); - static L4::Uart_pl011 _uart; + static L4::Uart_pl011 _uart(24019200); _uart.startup(&r); set_stdio_uart(&_uart); } diff --git a/l4/pkg/bootstrap/server/src/platform/rv_vexpress.cc b/l4/pkg/bootstrap/server/src/platform/rv_vexpress.cc index 3b92289f3..b6565ac54 100644 --- a/l4/pkg/bootstrap/server/src/platform/rv_vexpress.cc +++ b/l4/pkg/bootstrap/server/src/platform/rv_vexpress.cc @@ -27,7 +27,7 @@ class Platform_arm_rv_vexpress : public Platform_single_region_ram void init() { static L4::Io_register_block_mmio r(0x10009000); - static L4::Uart_pl011 _uart; + static L4::Uart_pl011 _uart(24019200); _uart.startup(&r); set_stdio_uart(&_uart); } diff --git a/l4/pkg/drivers-frst/uart/include/uart_pl011.h b/l4/pkg/drivers-frst/uart/include/uart_pl011.h index 0442bcc8d..e2e6af0f1 100644 --- a/l4/pkg/drivers-frst/uart/include/uart_pl011.h +++ b/l4/pkg/drivers-frst/uart/include/uart_pl011.h @@ -16,6 +16,7 @@ namespace L4 class Uart_pl011 : public Uart { public: + Uart_pl011(unsigned freq) : _freq(freq) {} bool startup(Io_register_block const *); void shutdown(); bool change_mode(Transfer_mode m, Baud_rate r); @@ -24,6 +25,9 @@ namespace L4 int char_avail() const; inline void out_char(char c) const; int write(char const *s, unsigned long count) const; + + private: + unsigned _freq; }; }; diff --git a/l4/pkg/drivers-frst/uart/src/uart_pl011.cc b/l4/pkg/drivers-frst/uart/src/uart_pl011.cc index 5167a993f..e0d0abf8b 100644 --- a/l4/pkg/drivers-frst/uart/src/uart_pl011.cc +++ b/l4/pkg/drivers-frst/uart/src/uart_pl011.cc @@ -49,16 +49,18 @@ namespace L4 UART011_IMSC = 0x38, UART011_MIS = 0x40, UART011_ICR = 0x44, - }; + Default_baud = 115200, + }; bool Uart_pl011::startup(Io_register_block const *regs) { _regs = regs; _regs->write(UART011_CR, UART01x_CR_UARTEN | UART011_CR_TXE | UART011_CR_RXE); - _regs->write(UART011_FBRD, 2); - _regs->write(UART011_IBRD, 13); - _regs->write(UART011_LCRH, 0x60); + unsigned fi_val = _freq * 4 / Default_baud; + _regs->write(UART011_FBRD, fi_val & 0x3f); + _regs->write(UART011_IBRD, fi_val >> 6); + _regs->write(UART011_LCRH, UART01x_LCRH_WLEN_8); _regs->write(UART011_IMSC, 0); Poll_timeout_counter i(3000000); while (i.test() && _regs->read(UART01x_FR) & UART01x_FR_BUSY) @@ -88,14 +90,12 @@ namespace L4 bool Uart_pl011::change_mode(Transfer_mode, Baud_rate r) { - if (r != 115200) - return false; - unsigned long old_cr = _regs->read(UART011_CR); _regs->write(UART011_CR, 0); - _regs->write(UART011_FBRD, 2); - _regs->write(UART011_IBRD, 13); + unsigned fi_val = _freq * 4 / r; + _regs->write(UART011_FBRD, fi_val & 0x3f); + _regs->write(UART011_IBRD, fi_val >> 6); _regs->write(UART011_LCRH, UART01x_LCRH_WLEN_8 | UART01x_LCRH_FEN); _regs->write(UART011_CR, old_cr); diff --git a/l4/pkg/examples/sys/vmtest/svmtest.c b/l4/pkg/examples/sys/vmtest/svmtest.c index 28e280ae1..14802718f 100644 --- a/l4/pkg/examples/sys/vmtest/svmtest.c +++ b/l4/pkg/examples/sys/vmtest/svmtest.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -37,8 +38,8 @@ static unsigned long gdt[32 * 2] __attribute__((aligned(4096))); void vm_resume(void); void handle_vmexit(void); -l4_vcpu_state_t *vcpu; -l4_vm_svm_vmcb_t *vmcb_s; +static l4_vcpu_state_t *vcpu; +static l4_vm_svm_vmcb_t *vmcb_s; static void init_vmcb(l4_vm_svm_vmcb_t *vmcb_s) { @@ -131,7 +132,7 @@ static int check_svm_npt(void) { return (!(dx & 1)); } -int vmexit = 0; +static int vmexit = 0; static int cnt_triggered, cnt_received; @@ -237,16 +238,14 @@ void handle_vmexit(void) { } } -static l4_vcpu_state_t *get_state_mem(l4_addr_t *extstate) { - static int done; +static l4_addr_t get_state_mem(void) +{ long r; l4_msgtag_t tag; static l4_addr_t ext_state; - if (done) { - *extstate = ext_state; - return vcpu; - } + if (ext_state) + return ext_state; if ((r = l4vcpu_ext_alloc(&vcpu, &ext_state, L4_BASE_TASK_CAP, l4re_env()->rm))) { @@ -254,6 +253,8 @@ static l4_vcpu_state_t *get_state_mem(l4_addr_t *extstate) { exit(1); } + assert(ext_state); + vcpu->state = L4_VCPU_F_FPU_ENABLED; vcpu->saved_state = L4_VCPU_F_USER_MODE | L4_VCPU_F_FPU_ENABLED | L4_VCPU_F_IRQ; @@ -270,10 +271,7 @@ static l4_vcpu_state_t *get_state_mem(l4_addr_t *extstate) { exit(1); } - done = 1; - *extstate = ext_state; - - return vcpu; + return ext_state; } @@ -283,8 +281,7 @@ static void run_test(int np_available) { l4_cap_idx_t vm_task = l4re_util_cap_alloc(); // int i; l4_umword_t ip; //, marker, test_end; - l4_addr_t vmcx; - get_state_mem(&vmcx); + l4_addr_t vmcx = get_state_mem(); printf("run test, np_available=%d\n", np_available); diff --git a/l4/pkg/io/config/x86-legacy.devs b/l4/pkg/io/config/x86-legacy.devs index 1a348b3d2..85887195f 100644 --- a/l4/pkg/io/config/x86-legacy.devs +++ b/l4/pkg/io/config/x86-legacy.devs @@ -24,6 +24,7 @@ Io.hw_add_devices hid = "PNP0900"; Res.io(0x3b0, 0x3bf); -- MDA Res.io(0x3c0, 0x3df); -- EGA/VGA + Res.io(0x1ce, 0x1d0); -- Vbox Res.mmio(0xa0000, 0xbffff, 0xc000); }, diff --git a/l4/pkg/io/server/libpciids/src/pci.ids b/l4/pkg/io/server/libpciids/src/pci.ids index 211c0a948..6a6b9efc6 100644 --- a/l4/pkg/io/server/libpciids/src/pci.ids +++ b/l4/pkg/io/server/libpciids/src/pci.ids @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2012.08.15 -# Date: 2012-08-15 03:15:02 +# Version: 2013.01.05 +# Date: 2013-01-05 03:15:02 # # Maintained by Martin Mares and other volunteers from the # PCI ID Project at http://pci-ids.ucw.cz/. @@ -21,7 +21,6 @@ # device device_name <-- single tab # subvendor subdevice subsystem_name <-- two tabs -0000 Gammagraphx, Inc. (or missing ID) 0010 Allied Telesis, Inc # This is a relabelled RTL-8139 8139 AT-2500TX V3 Ethernet @@ -80,27 +79,13 @@ 0357 TTTech AG 000a TTP-Monitoring Card V2.0 036f Trigem Computer Inc. -0403 Future Technology Devices International Ltd 0432 SCM Microsystems, Inc. 0001 Pluto2 DVB-T Receiver for PCMCIA [EasyWatch MobilSet] -0482 Kyocera -# vendor code used for (at a minimum) RSA cards -04b3 IBM Corp. - 4001 Remote System Administration device [RSA2] -050d Belkin -05a9 OmniVision - 8519 OV519 series -05e3 CyberDoor - 0701 CBD516 -066f SigmaTel - 3410 SMTP3410 - 3500 SMTP3500 0675 Dynalink 1700 IS64PH ISDN Adapter 1702 IS64PH ISDN Adapter 1703 ISDN Adapter (PCI Bus, DV, W) 1704 ISDN Adapter (PCI Bus, D, C) -069d Hughes Network Systems (HNS) 0721 Sapphire, Inc. 0777 Ubiquiti Networks, Inc. # Atheros, 6th Generation, AR5414, 802.11a, 5GHz @@ -325,6 +310,8 @@ 4c53 1080 CT8 mainboard 4c53 1300 P017 mezzanine (32-bit PMC) 4c53 1310 P017 mezzanine (64-bit PMC) + 002f MegaRAID SAS 2208 IOV [Thunderbolt] + 1028 1f3e SPERC 8 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI 0e11 00da ProLiant ML 350 1028 0123 LSI Logic 1020/1030 @@ -377,7 +364,21 @@ 005b MegaRAID SAS 2208 [Thunderbolt] 1000 9265 MegaRAID SAS 9265-8i 1000 9266 MegaRAID SAS 9266-8i + 1000 9267 MegaRAID SAS 9267-8i 1000 9268 MegaRAID SAS 9265CV-8i / 9270CV-8i + 1000 9269 MegaRAID SAS 9266-4i + 1000 9270 MegaRAID SAS 9270-8i + 1000 9271 MegaRAID SAS 9271-8i + 1000 9272 MegaRAID SAS 9272-8i + 1000 9273 MegaRAID SAS 9270CV-8i + 1000 9274 MegaRAID SAS 9270-4i + 1000 9275 MegaRAID SAS 9271-8iCC + 1000 9276 MegaRAID SAS 9271-4i + 1000 9285 MegaRAID SAS 9285-8e + 1000 9288 MegaRAID SAS 9285CV-8e + 1000 9290 MegaRAID SAS 9286-8e + 1000 9291 MegaRAID SAS 9286CV-8e + 1000 9295 MegaRAID SAS 9286CV-8eCC 1014 040b ServeRAID M5110 SAS/SATA Controller 1014 0412 ServeRAID M5110e SAS/SATA Controller 1028 1f2d PERC H810 Adapter @@ -945,6 +946,7 @@ 1028 014a PowerEdge 1750 1028 0165 PowerEdge 750 103c 10e1 NetServer Rage XL + 103c 3208 ProLiant DL140 G2 107b 6400 6400 Server 1734 007a PRIMERGY RX/TX series onboard VGA 8086 3411 SDS2 Mainboard @@ -1429,6 +1431,7 @@ 5a1e RD890 PCI to PCI bridge (external gfx1 port B) 5a1f RD890 PCI to PCI bridge (NB-SB link) 15d9 a811 H8DGU + 5a20 RD890S PCI Express bridge for GPP2 port 1 5a23 RD990 I/O Memory Management Unit (IOMMU) 5a33 Radeon Xpress 200 Host Bridge 5a34 RS480 PCI-X Root Port @@ -1510,6 +1513,12 @@ 5e6d RV410 [Radeon X700 (PCIE)] (Secondary) 148c 2117 PowerColor Bravo X700 5f57 R423 [Radeon X800XT (PCIE)] + 6600 Mars [Radeon HD 8600/8700M Series] + 6601 Mars [Radeon HD 8500/8700M Series] + 6606 Mars [Radeon HD 8790M] + 6610 Oland [Radeon HD 8600 Series] + 6611 Oland [Radeon HD 8500 Series] + 6704 Cayman PRO GL [FirePro V7900] 6707 Cayman LE GL [FirePro V5900] 6718 Cayman XT [Radeon HD 6970] 6719 Cayman PRO [Radeon HD 6950] @@ -1545,18 +1554,28 @@ 6798 Tahiti XT [Radeon HD 7970] 6799 New Zealand [Radeon HD 7990] 679a Tahiti PRO [Radeon HD 7950] - 6800 WIMBLEDON XT [Radeon HD 7970M] - 6818 PITCAIRN [Radeon HD 7800] - 6819 PITCAIRN PRO [Radeon HD 7800 Series] + 679e Tahiti LE [Radeon HD 7800 Series] + 6800 Wimbledon XT [Radeon HD 7970M] + 6818 Pitcairn [Radeon HD 7800] + 6819 Pitcairn PRO [Radeon HD 7800] + 6820 Radeon HD 8800M Series + 6821 Radeon HD 8800M Series + 6823 Radeon HD 8800M Series + 6825 Cape Verde [Radeon HD 7800M Series] + 682b Radeon HD 8800M Series 682f Cape Verde [Radeon HD 7700M Series] + 683b Cape Verde [Radeon HD 7700 Series] 683d Cape Verde [Radeon HD 7700 Series] 683f Cape Verde PRO [Radeon HD 7700 Series] 6840 Thames XT/GL [Radeon HD 7600M Series] 6841 Thames [Radeon 7500M/7600M Series] + 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] 6850 Lombok GL AIO [Radeon HD 7570] 6858 Lombok [Radeon HD 7400 series] + 6888 Cypress [FirePro 3D V8800] 6889 Cypress [FirePro V7800] + 688a Cypress XT [FirePro 3D V9800] 688c Cypress [AMD FireStream 9370] 688d Cypress [AMD FireStream 9350] 6898 Cypress XT [Radeon HD 5870] @@ -1744,14 +1763,16 @@ 17f2 5000 KI690-AM2 Motherboard 791f RS690M [Radeon X1200 Series] 1179 ff50 Satellite P305D-S8995E - 7930 Radeon Xpress 7930 Host Bridge - 7932 RS7932 PCI Bridge - 7933 RS7933 PCI Bridge - 7936 RS7936 PCI Bridge - 793b RS600 audio device [Radeon Xpress 12xx Series] - 793f RS600 [Radeon Xpress 1200 Series] - 7941 RS600 [Radeon Xpress 1200 Series] - 7942 Radeon Xpress 1250 + 7930 RS600 Host Bridge + 7932 RS600 PCI to PCI Bridge (Internal gfx) + 7933 RS600 PCI to PCI Bridge (PCI Express Graphics Port 0) + 7935 RS600 PCI to PCI Bridge (PCI Express Port 1) + 7936 RS600 PCI to PCI Bridge (PCI Express Port 2) + 7937 RS690 PCI to PCI Bridge (PCI Express Port 3) + 793b RS600 HDMI Audio [Radeon Xpress 1250] + 793f RS600 [Radeon Xpress 1250] + 7941 RS600 [Radeon Xpress 1250] + 7942 RS600 [Radeon Xpress 1250] 796e Radeon 2100 7c37 RV350 AQ [Radeon 9600 SE] 9400 R600 [Radeon HD 2900 Series] @@ -1888,6 +1909,11 @@ 9804 Wrestler [Radeon HD 6250] 9806 Wrestler [Radeon HD 6320] 9807 Wrestler [Radeon HD 6290] +# AMD A10-5800K CPU + 9901 Trinity [Radeon HD 7660D] + 9902 Trinity HDMI Audio Controller + 9904 Trinity [Radeon HD 7560D] + 9990 Trinity [Radeon HD 7520G] aa00 R600 Audio Device [Radeon HD 2900 Series] aa08 RV630 audio device [Radeon HD 2600 Series] aa10 RV610 HDMI Audio [Radeon HD 2350/2400 Series] @@ -1915,6 +1941,7 @@ aa98 Caicos HDMI Audio [Radeon HD 6400 Series] 174b aa98 Sapphire HD 6450 1GB DDR3 aaa0 Tahiti XT HDMI Audio [Radeon HD 7970 Series] + aab0 Cape Verde HDMI Audio [Radeon HD 7700 Series] ac00 Theater 600 Pro ac02 TV Wonder HD 600 PCIe ac12 Theater HD T507 (DVB-T) TV tuner/capture device @@ -2306,6 +2333,7 @@ 0339 Obsidian-E PCI-E SCSI controller 1014 030a PCIe 3Gb SAS RAID Adapter (574E) 1014 033a PCIe 3Gb SAS Adapter (57B3) + 1014 035c PCIe x8 Internal 3Gb SAS adapter (57CC) 1014 0360 PCI-E Auxiliary Cache Adapter (57B7) 033d PCI-E IPR SAS Adapter (FPGA) 1014 033c PCIe2 1.8GB Cache 6Gb SAS RAID Adapter Tri-port (57B5) @@ -2319,6 +2347,7 @@ 1014 0357 PCIe2 6Gb SAS Adapter Quad-port (57C6) 1014 035d PCIe3 1.8GB Cache RAID SAS Adapter Quad-port 6GB (57C8) 1014 035e PCIe2 3.6GB Cache 6Gb SAS RAID Adapter Quad-port (57CE) + 1014 03fb PCIe3 28GB Cache RAID SAS Enclosure 6Gb x 16 (57D5) 3022 QLA3022 Network Adapter 4022 QLA3022 Network Adapter ffff MPIC-2 interrupt controller @@ -2420,6 +2449,7 @@ 1417 Family 15h (Models 10h-1fh) Processor Root Port 1418 Family 15h (Models 10h-1fh) Processor Root Port 1419 Family 15h (Models 10h-1fh) I/O Memory Management Unit + 1439 Family 16h Processor Functions 5:1 1510 Family 14h Processor Root Complex 174b 1001 Sapphire PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -2428,6 +2458,14 @@ 1514 Family 14h Processor Root Port 1515 Family 14h Processor Root Port 1516 Family 14h Processor Root Port + 1530 Family 16h Processor Function 0 + 1531 Family 16h Processor Function 1 + 1532 Family 16h Processor Function 2 + 1533 Family 16h Processor Function 3 + 1534 Family 16h Processor Function 4 + 1535 Family 16h Processor Function 5 + 1536 Family 16h Processor Root Complex + 1538 Family 16h Processor Function 0 1600 Family 15h Processor Function 0 1601 Family 15h Processor Function 1 1602 Family 15h Processor Function 2 @@ -2492,6 +2530,10 @@ 2097 CS5536 [Geode companion] UOC 209a CS5536 [Geode companion] IDE 3000 ELanSC520 Microcontroller + 43a0 Hudson PCI to PCI bridge (PCIE port 0) + 43a1 Hudson PCI to PCI bridge (PCIE port 1) + 43a2 Hudson PCI to PCI bridge (PCIE port 2) + 43a3 Hudson PCI to PCI bridge (PCIE port 3) 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge 700a AMD-IGR4 AGP Host to PCI Bridge @@ -2546,23 +2588,24 @@ 161f 3017 HDAMB 746e AMD-8111 MC97 Modem 756b AMD-8111 ACPI - 7800 Hudson SATA Controller [IDE mode] - 7801 Hudson SATA Controller [AHCI mode] - 7802 Hudson SATA Controller [RAID mode] - 7803 Hudson SATA Controller [RAID mode] - 7804 Hudson SATA Controller [AHCI mode] - 7805 Hudson SATA Controller [RAID mode] - 7806 Hudson SD Flash Controller - 7807 Hudson USB OHCI Controller - 7808 Hudson USB EHCI Controller - 7809 Hudson USB OHCI Controller - 780b Hudson SMBus Controller - 780c Hudson IDE Controller - 780d Hudson Azalia Controller - 103c 168b Integrated Device Technology, Inc. [IDT] 92HD87B1/3 Audio Processor - 780e Hudson LPC Bridge - 780f Hudson PCI Bridge - 7812 Hudson USB XHCI Controller + 7800 FCH SATA Controller [IDE mode] + 7801 FCH SATA Controller [AHCI mode] + 7802 FCH SATA Controller [RAID mode] + 7803 FCH SATA Controller [RAID mode] + 7804 FCH SATA Controller [AHCI mode] + 7805 FCH SATA Controller [RAID mode] + 7806 FCH SD Flash Controller + 7807 FCH USB OHCI Controller + 7808 FCH USB EHCI Controller + 7809 FCH USB OHCI Controller + 780b FCH SMBus Controller + 780c FCH IDE Controller + 780d FCH Azalia Controller + 780e FCH LPC Bridge + 780f FCH PCI Bridge + 7812 FCH USB XHCI Controller + 7813 FCH SD Flash Controller + 7814 FCH USB XHCI Controller 9600 RS780 Host Bridge 1043 82f1 M3A78-EH Motherboard 9601 RS880 Host Bridge @@ -2811,6 +2854,7 @@ 102b ff04 Marvel G200 AGP 110a 0032 MGA-G200 AGP 0522 MGA G200e [Pilot] ServerEngines (SEP1) + 103c 31fa ProLiant DL140 G3 0525 MGA G400/G450 0e11 b16f MGA-G400 AGP 102b 0328 Millennium G400 16Mb SDRAM @@ -3302,6 +3346,7 @@ 7007 FireWire Controller 1462 701d MS-6701 7012 SiS7012 AC'97 Sound Controller + 1019 0f05 A928 (i-Buddie) 1039 7012 SiS 7012 onboard [Asus P4SC-EA] AC'97 Sound Controller 1043 818f A8S-X Motherboard 13f6 0300 CMI9739(A) on ECS K7SOM+ motherboard @@ -3463,6 +3508,8 @@ 103c 330e iLO3 103c 3381 iLO4 3307 Integrated Lights-Out Standard Management Processor Support and Messaging +# HP DL380 G6 + 103c 3309 iLO 2 103c 330e iLO3 103c 3381 iLO4 3308 Integrated Lights-Out Standard MS Watchdog Timer @@ -3474,7 +3521,6 @@ 4037 PCIe Local Bus Adapter 403b PCIe Root Port 60e8 NetRAID-2M : ZX1/M (OEM AMI MegaRAID 493) - 780d Hudson Azalia Controller (rev 01) - Soundcard 103e Solliday Engineering 103f Synopsys/Logic Modeling Group 1040 Accelgraphics Inc. @@ -3713,6 +3759,7 @@ 103c 006a NX9500 1043 808d A7V333 mainboard. 8027 PCI4451 IEEE-1394 Controller + 1028 00e5 Latitude C810 1028 00e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100) 8029 PCI4510 IEEE-1394 Controller 1028 0163 Latitude D505 @@ -3785,6 +3832,7 @@ 823f XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express] 1546 803c FWB-PCIE1X11B 8240 XIO2001 PCI Express-to-PCI Bridge + 8241 TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller 8400 ACX 100 22Mbps Wireless Interface 1186 3b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus] 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter @@ -4928,6 +4976,10 @@ 10b4 237e Velocity 4400 10b5 PLX Technology, Inc. 0001 i960 PCI bus interface + 0557 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 Digium Tormenta 2 T400P-SS7 or E400P-SS7 Quad T1 or E1 PCI card + 1000 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 ATCOM AT400P Quad T1 PCI card 1024 Acromag, Inc. IndustryPack Carrier Card 1042 Brandywine / jxi2, Inc. - PMC-SyncClock32, IRIG A & B, Nasa 36 106a Dual OX16C952 4 port serial adapter [Megawolf Romulus/4] @@ -4937,9 +4989,17 @@ 1103 VScom 200 2 port serial adaptor 1146 VScom 010 1 port parallel adaptor 1147 VScom 020 2 port parallel adaptor + 2000 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 ATCOM AE400P Quad E1 PCI card 2540 IXXAT CAN-Interface PC-I 04/PCI 2724 Thales PCSM Security Card 3376 Cosateq 4 Port CAN Card + 4000 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 9030 Tormenta 3 Varion V400P/ATCOM TE400P Quad E1/T1/J1 PCI card + 4001 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 ATCOM A400PE Quad E1 PCI card + 4002 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 ATCOM A400PT Quad T1 PCI card 6140 PCI6140 32-bit 33MHz PCI-to-PCI Bridge 6150 PCI6150 32-bit 33MHz PCI-to-PCI Bridge 6152 PCI6152 32-bit 66MHz PCI-to-PCI Bridge @@ -4974,6 +5034,7 @@ 8547 PEX 8547 48-lane, 3-port PCI Express Switch 8548 PEX 8548 48-lane, 9-port PCI Express Switch 8604 PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch + 8605 PEX 8605 PCI Express 4-port Gen2 Switch 8606 PEX 8606 6 Lane, 6 Port PCI Express Gen 2 (5.0 GT/s) Switch 8608 PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch 8609 PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA @@ -5001,7 +5062,7 @@ 87b0 PEX 8732 32-lane, 8-Port PCI Express Gen 3 (8.0 GT/s) Switch 9016 PLX 9016 8-port serial controller 9030 PCI9030 32-bit 33MHz PCI <-> IOBus Bridge - 10b5 2695 Hilscher CIF50-PB Profibus Master Board + 10b5 2695 Hilscher CIF50-PB/DPS Profibus 10b5 2862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board 10b5 2906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board 10b5 2940 Alpermann+Velte PCL PCI D (3V/5V): Timecode Reader Board @@ -5102,6 +5163,7 @@ 10b5 3354 Alpermann+Velte PCL PCIe LV: Timecode Reader Board 10b5 3355 Alpermann+Velte PCL PCIe L: Timecode Reader Board 10b5 3415 Alpermann+Velte PCIe TS: Time Synchronisation Board + 10b5 3493 Alpermann+Velte PCL PCIe 3G: Timecode Reader Board 1369 c001 LX6464ES 1369 c201 LX1616ES 14b4 d10a DekTec DTA-110T @@ -5134,6 +5196,15 @@ a100 Blackmagic Design DeckLink bb04 B&B 3PCIOSD1A Isolated PCI Serial c001 CronyxOmega-PCI (8-port RS232) + d00d PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 10b5 9030 Digium Tormenta 2 T400P or E400P Quad T1 or E1 PCI card + d33d PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 Tormenta 3 Varion V401PT Quad T1/J1 PCI card + d44d PCI9030 32-bit 33MHz PCI <-> IOBus Bridge + 105b 9030 Tormenta 3 Varion V401PE Quad E1 PCI card + 10b5 17f6 Allo CP100P/E 1-port E1/T1/J1 PCI/PCIe card + 10b5 17f7 Allo CP400P/E 4-port E1/T1/J1 PCI/PCIe card + 10b5 17f8 Allo CP200P/E 2-port E1/T1/J1 PCI/PCIe card 10b6 Madge Networks 0001 Smart 16/4 PCI Ringnode 0002 Smart 16/4 PCI Ringnode Mk2 @@ -6166,6 +6237,7 @@ 0259 NV25GL [Quadro4 750 XGL] 025b NV25GL [Quadro4 700 XGL] 0260 MCP51 LPC Bridge + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 1458 5001 GA-M55plus-S3G @@ -6175,25 +6247,30 @@ 0262 MCP51 LPC Bridge 0263 MCP51 LPC Bridge 0264 MCP51 SMBus + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 105b 0cad Winfast 6100K8MB 1462 7207 K8NGM2 series 0265 MCP51 IDE + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 1462 7207 K8NGM2 series # Foxconn has used a wrong vendor ID for this one f05b 0cad Winfast 6100K8MB 0266 MCP51 Serial ATA Controller + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 1462 7207 K8NGM2 series 0267 MCP51 Serial ATA Controller + 103c 2a34 Pavilion a1677c 1043 81bc A8N-VM CSM Mainboard 1462 7207 K8NGM2 series 0268 MCP51 Ethernet Controller 0269 MCP51 Ethernet Controller + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 8141 A8N-VM CSM Mainboard 1462 7207 K8NGM2 series @@ -6201,16 +6278,19 @@ 026b MCP51 AC97 Audio Controller 105b 0cad Winfast 6100K8MB 026c MCP51 High Definition Audio + 103c 2a34 Pavilion a1677c 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 10de cb84 ASUSTeK Computer Inc. A8N-VM CSM Mainboard 1462 7207 K8NGM2 series 026d MCP51 USB Controller + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 105b 0cad Winfast 6100K8MB 1462 7207 K8NGM2 series 026e MCP51 USB Controller + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 105b 0cad Winfast 6100K8MB @@ -6218,6 +6298,7 @@ 026f MCP51 PCI Bridge 103c 30b7 Presario V6133CL 0270 MCP51 Host Bridge + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81bc A8N-VM CSM Mainboard 105b 0cad Winfast 6100K8MB @@ -6227,13 +6308,16 @@ 103c 30b5 Presario V3242AU 103c 30b7 Presario V6133CL 0272 MCP51 Memory Controller 0 + 103c 2a34 Pavilion a1677c 105b 0cad Winfast 6100K8MB 027e C51 Memory Controller 2 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G 1462 7207 K8NGM2 series 027f C51 Memory Controller 3 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G @@ -6278,6 +6362,7 @@ 02e4 G71 [GeForce 7950 GT] 1682 2271 PV-T71A-YDF7 (512MB) 02f0 C51 Host Bridge + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1462 7207 K8NGM2 series @@ -6290,16 +6375,19 @@ 02f6 C51 Host Bridge 02f7 C51 Host Bridge 02f8 C51 Memory Controller 5 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G 1462 7207 K8NGM2 series 02f9 C51 Memory Controller 4 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G 1462 7207 K8NGM2 series 02fa C51 Memory Controller 0 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G @@ -6310,11 +6398,13 @@ 02fd C51 PCI Express Bridge 103c 30b7 Presario V6133CL 02fe C51 Memory Controller 1 + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G 1462 7207 K8NGM2 series 02ff C51 Host Bridge + 103c 2a34 Pavilion a1677c 103c 30b7 Presario V6133CL 1043 81cd A8N-VM CSM Mainboard 1458 5000 GA-M55plus-S3G @@ -6663,10 +6753,12 @@ 1849 0562 ALiveNF7G-HDready 0563 MCP67 PCI Express Bridge 0568 MCP78S [GeForce 8200] Memory Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0568 K10N78FullHD-hSLI R3.0 Memory Controller 0569 MCP78S [GeForce 8200] PCI Express Bridge + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0569 K10N78FullHD-hSLI R3.0 PCI Express Bridge @@ -6815,18 +6907,22 @@ 06fd G98 [Quadro NVS 295] 06ff G98 [HICx16 + Graphics] 0751 MCP78S [GeForce 8200] Memory Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0751 K10N78FullHD-hSLI R3.0 Memory Controller 0752 MCP78S [GeForce 8200] SMBus + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0752 K10N78FullHD-hSLI R3.0 SMBus 0753 MCP78S [GeForce 8200] Co-Processor + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0753 K10N78FullHD-hSLI R3.0 Co-Processor 0754 MCP78S [GeForce 8200] Memory Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0754 K10N78FullHD-hSLI R3.0 Memory Controller @@ -6835,18 +6931,22 @@ 1462 7508 K9N2GM-FIH 1849 0759 K10N78FullHD-hSLI R3.0 IDE 075a MCP78S [GeForce 8200] PCI Bridge + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1849 075a K10N78FullHD-hSLI R3.0 PCI Bridge 075b MCP78S [GeForce 8200] PCI Express Bridge + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 075b K10N78FullHD-hSLI R3.0 PCI Express Bridge 075c MCP78S [GeForce 8200] LPC Bridge + 103c 2a9e Pavilion p6310f 1462 7508 K9N2GM-FIH 1849 075c K10N78FullHD-hSLI R3.0 LPC Bridge 075d MCP78S [GeForce 8200] LPC Bridge 1043 82e8 M3N72-D 0760 MCP77 Ethernet + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0760 K10N78FullHD-hSLI R3.0 Ethernet @@ -6854,31 +6954,38 @@ 0762 MCP77 Ethernet 0763 MCP77 Ethernet 0774 MCP72XE/MCP72P/MCP78U/MCP78S High Definition Audio + 103c 2a9e Pavilion p6310f # has a Realtek ALC1200 HDAudio Codec 1043 82fe M3N72-D 1462 7508 K9N2GM-FIH 1849 3662 K10N78FullHD-hSLI R3.0 High Definition Audio 0778 MCP78S [GeForce 8200] PCI Express Bridge + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 0778 K10N78FullHD-hSLI R3.0 PCI Express Bridge 077a MCP78S [GeForce 8200] PCI Bridge + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 077a K10N78FullHD-hSLI R3.0 PCI Bridge 077b MCP78S [GeForce 8200] OHCI USB 1.1 Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 077b K10N78FullHD-hSLI R3.0 OHCI USB 1.1 Controller 077c MCP78S [GeForce 8200] EHCI USB 2.0 Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 077c K10N78FullHD-hSLI R3.0 EHCI USB 2.0 Controller 077d MCP78S [GeForce 8200] OHCI USB 1.1 Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 077d K10N78FullHD-hSLI R3.0 OHCI USB 1.1 Controller 077e MCP78S [GeForce 8200] EHCI USB 2.0 Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1462 7508 K9N2GM-FIH 1849 077e K10N78FullHD-hSLI R3.0 EHCI USB 2.0 Controller @@ -6954,6 +7061,7 @@ 0845 C77 [GeForce 8200M G] 0846 C77 [GeForce 9200] 0847 C78 [GeForce 9100] + 103c 2a9e Pavilion p6310f 0848 C77 [GeForce 8300] 0849 C77 [GeForce 8200] 1462 7508 K9N2GM-FIH @@ -6972,6 +7080,7 @@ 0865 C79 [GeForce 9300] 0866 C79 [GeForce 9400M G] 0867 C79 [GeForce 9400] + 106b 00ad iMac 9,1 0868 C79 [nForce 760i SLI] 086a C79 [GeForce 9400] 086c C79 [GeForce 9300 / nForce 730i] @@ -7011,6 +7120,8 @@ 0a65 GT218 [GeForce 210] 1043 8334 EN210 SILENT 0a66 GT218 [GeForce 310] +# taken from nv_disp.inf + 0a67 GT218 [GeForce 315] 0a68 G98M [GeForce G105M] 0a69 G98M [GeForce G105M] 0a6a GT218 [NVS 2100M] @@ -7038,30 +7149,42 @@ 0a87 MCP79 Host Bridge 0a88 MCP79 Memory Controller 0a89 MCP79 Memory Controller + 0a98 MCP79 Memory Controller + 10de cb79 iMac 9,1 0aa0 MCP79 PCI Express Bridge + 10de cb79 Apple iMac 9,1 0aa2 MCP79 SMBus + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aa3 MCP79 Co-processor + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aa4 MCP79 Memory Controller 19da a123 IONITX-F-E 0aa5 MCP79 OHCI USB 1.1 Controller + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aa6 MCP79 EHCI USB 2.0 Controller + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aa7 MCP79 OHCI USB 1.1 Controller + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aa8 MCP79 OHCI USB 1.1 Controller 0aa9 MCP79 EHCI USB 2.0 Controller + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0aaa MCP79 EHCI USB 2.0 Controller 0aab MCP79 PCI Bridge + 10de cb79 Apple iMac 9,1 0aac MCP79 LPC Bridge 0aad MCP79 LPC Bridge 19da a123 IONITX-F-E 0aae MCP79 LPC Bridge + 10de cb79 Apple iMac 9,1 0aaf MCP79 LPC Bridge 0ab0 MCP79 Ethernet + 10de cb79 Apple iMac 9,1 19da a123 IONITX-F-E 0ab1 MCP79 Ethernet 0ab2 MCP79 Ethernet @@ -7073,6 +7196,7 @@ 0ab7 MCP79 SATA Controller 0ab8 MCP79 AHCI Controller 0ab9 MCP79 AHCI Controller + 10de cb79 Apple iMac 9,1 0aba MCP79 AHCI Controller 0abb MCP79 AHCI Controller 0abc MCP79 RAID Controller @@ -7080,18 +7204,23 @@ 0abe MCP79 RAID Controller 0abf MCP79 RAID Controller 0ac0 MCP79 High Definition Audio + 10de cb79 Apple iMac 9,1 0ac1 MCP79 High Definition Audio 0ac2 MCP79 High Definition Audio 0ac3 MCP79 High Definition Audio 0ac4 MCP79 PCI Express Bridge + 10de cb79 Apple iMac 9,1 0ac5 MCP79 PCI Express Bridge 0ac6 MCP79 PCI Express Bridge + 10de cb79 Apple iMac 9,1 0ac7 MCP79 PCI Express Bridge + 10de cb79 Apple iMac 9,1 0ac8 MCP79 PCI Express Bridge 0ad0 MCP78S [GeForce 8200] SATA Controller (non-AHCI mode) 1462 7508 K9N2GM-FIH 1849 0ad0 K10N78FullHD-hSLI R3.0 IDE 0ad4 MCP78S [GeForce 8200] AHCI Controller + 103c 2a9e Pavilion p6310f 1043 82e8 M3N72-D 1849 0ad4 K10N78FullHD-hSLI R3.0 AHCI Controller 0ad8 MCP78S [GeForce 8200] SATA Controller (RAID mode) @@ -7113,9 +7242,13 @@ 0ca2 GT215 [GeForce GT 320] 0ca3 GT215 [GeForce GT 240] 0ca4 GT215 [GeForce GT 340] +# taken from nv_disp.inf + 0ca5 GT215 [GeForce GT 220] 0ca7 GT215 [GeForce GT 330] 0ca8 GT215 [GeForce GTS 260M] 0ca9 GT215 [GeForce GTS 250M] +# GT215, not GT216 per http://www.techpowerup.com/gpuz/594cm/ + 0cac GT215 [GeForce GT 220] 0caf GT215 [GeForce GT 335M] 0cb0 GT215 [GeForce GTS 350M] 0cb1 GT215 [GeForce GTS 360M] @@ -7136,7 +7269,13 @@ 0d94 MCP89 High Definition Audio 0d9c MCP89 OHCI USB 1.1 Controller 0d9d MCP89 EHCI USB 2.0 Controller +# taken from nv_disp.inf + 0dc0 GF108 [GeForce GT 440] 0dc4 GF106 [GeForce GTS 450] +# taken from nv_disp.inf + 0dc5 GF106 [GeForce GTS 450] +# taken from nv_disp.inf + 0dc6 GF106 [GeForce GTS 450] 0dcd GF106 [GeForce GT 555M] 0dce GF106 [GeForce GT 555M] # rev a1 @@ -7144,48 +7283,95 @@ 1558 8687 CLEVO/KAPOK W860CU 0dd2 GF106 [GeForce GT 445M] 0dd8 GF106GL [Quadro 2000] - 0dda GF106 [Quadro 2000M] +# NVIDIA calls it GF106GML + 0dda GF106GLM [Quadro 2000M] 0de0 GF108 [GeForce GT 440] 0de1 GF108 [GeForce GT 430] 3842 1430 GeForce GT 430 0de2 GF108 [GeForce GT 420] - 0de9 GeForce GT 630M +# taken from nv_disp.inf + 0de4 GF108 [GeForce GT 520] +# taken from nv_disp.inf + 0de5 GF108 [GeForce GT 530] + 0de9 GF108 [GeForce GT 630M] # Not fully sure that it's GF108, might also be GF106. 0deb GF108 [GeForce GT 555M] 0dee GF108 [GeForce GT 415M] 0def GF108 [Quadro NVS 5400M] 0df0 GF108 [GeForce GT 425M] + 0df1 GF108 [GeForce GT 420M] 0df2 GF108 [GeForce GT 435M] 0df4 GF108 [GeForce GT 540M] 0df5 GF108 [GeForce GT 540M] 0df7 GF108 [GeForce GT 520M] - 0df8 GF108 [Quadro 600] - 0df9 GF108 [Quadro 500M] - 0dfa GF108 [Quadro 1000M] +# NVIDIA calls it GL + 0df8 GF108GL [Quadro 600] +# NVIDIA calls it GLM + 0df9 GF108GLM [Quadro 500M] +# NVIDIA calls it GLM + 0dfa GF108GLM [Quadro 1000M] 0e08 GF119 HDMI Audio Controller 0e09 GF110 High Definition Audio Controller 0e0a GK104 HDMI Audio Controller 0e0c GF114 HDMI Audio Controller + 0e1b GK107 HDMI Audio Controller + 1043 8428 GTX650-DC-1GD5 0e22 GF104 [GeForce GTX 460] 1462 2322 N460GTX Cyclone 1GD5/OC +# taken from nv_disp.inf + 0e23 GF104 [GeForce GTX 460 SE] +# taken from nv_disp.inf + 0e24 GF104 [GeForce GTX 460] 0e3a GF104 [Quadro 3000M] 0e3b GF104 [Quadro 4000M] + 0f00 GK107 [GeForce GT 630] +# Probably GF108 + 0f01 GeForce GT 620 +# taken from nv_disp.inf + 0fc0 GK107 [GeForce GT 640] +# taken from nv_disp.inf + 0fc1 GK107 [GeForce GT 640] + 0fc6 GK107 [GeForce GTX 650] + 1043 8428 GTX650-DC-1GD5 0fd1 GK107 [GeForce GT 650M] + 1043 2103 N56VZ 0fd2 GK107 [GeForce GT 640M] + 0ff2 GK107 [VGX K1] + 0ffa GK107 [Quadro K600] 0ffb GK107 [Quadro K2000M] 0ffc GK107 [Quadro K1000M] + 0ffe GK107 [Quadro K2000] + 0fff GK107 [Quadro 410] 1040 GF119 [GeForce GT 520] +# taken from nv_disp.inf + 1042 GF119 [GeForce 510] +# taken from nv_disp.inf + 1048 GF119 [GeForce 605] +# taken from nv_disp.inf + 1049 GF119 [GeForce GT 620] +# taken from nv_disp.inf + 104a GF119 [GeForce GT 610] 1050 GF119 [GeForce GT 520M] 1051 GF119 [GeForce GT 520MX] + 1055 GF119 [GeForce 410M] 1056 GF119 [Quadro NVS 4200M] 1057 GF119 [Quadro NVS 4200M] 105a GF119 [GeForce 610M] + 107d GF119 [Quadro NVS 310] 1080 GF110 [GeForce GTX 580] 1081 GF110 [GeForce GTX 570] 10de 087e Leadtek WinFast GTX 570 1082 GF110 [GeForce GTX 560 Ti] +# taken from nv_disp.inf + 1084 GF110 [GeForce GTX 560] 1086 GF110 [GeForce GTX 570 HD] 1087 GF110 [GeForce GTX 560 Ti 448 Cores] +# taken from nv_disp.inf + 1088 GF110 [GeForce GTX 590] +# taken from nv_disp.inf + 1089 GF110 [GeForce GTX 580] +# taken from nv_disp.inf + 108b GF110 [GeForce GTX 580] 1091 Tesla M2090 1094 Tesla M2075 Dual-Slot Computing Processor Module 1096 Tesla C2075 @@ -7198,15 +7384,33 @@ 1183 GK104 [GeForce GTX 660 Ti] 1188 GK104 [GeForce GTX 690] 1189 GK104 [GeForce GTX 670] + 11ba GK104 [Quadro K5000] 11bc GK104 [Quadro K5000M] 11bd GK104 [Quadro K4000M] 11be GK104 [Quadro K3000M] + 11bf GK104GL [VGX K2] + 11fa GK104 [Quadro K4000] 1200 GF114 [GeForce GTX 560 Ti] 1201 GF114 [GeForce GTX 560] 1205 GF114 [GeForce GTX 460 v2] +# taken from nv_disp.inf + 1206 GF114 [GeForce GTX 555] +# taken from nv_disp.inf + 1207 GF114 [GeForce GTX 645] +# taken from nv_disp.inf + 1208 GF114 [GeForce GTX 560 SE] + 1210 GF114 [GeForce GTX 570M] +# GT, not GTX + 1241 GF116 [GeForce GT 545] +# GT, not GTX + 1243 GF116 [GeForce GT 545] 1244 GF116 [GeForce GTX 550 Ti] 1245 GF116 [GeForce GTS 450] - 1247 GF106 [GeForce GT 555M] + 1247 GF116 [GeForce GT 555M] +# taken from nv_disp.inf + 1249 GF116 [GeForce GTS 450] +# taken from nv_disp.inf + 124b GF116 [GeForce GT 640] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 0722 OneConnect iSCSI Initiator (Skyhawk) @@ -7361,6 +7565,7 @@ 0885 Realtek 885 High Definition Audio 0888 Realtek 888 High Definition Audio 1028 020d Inspiron 530 + 0892 Realtek 892 High Definition Audio 5209 RTS5209 PCI Express Card Reader 5229 RTS5229 PCI Express Card Reader 5288 Barossa PCI Express Card Reader @@ -7602,8 +7807,8 @@ 0009 [SB X-Fi Xtreme Audio] CA0110-IBG 1102 0010 [SB X-Fi Xtreme Audio] CA0110-IBG 1102 0018 SB1040 - 000b X-Fi Titanium series [EMU20k2] - 1102 0041 SB X-Fi Titanium PCI-e [SB0880] + 000b EMU20k2 [X-Fi Titanium Series] + 1102 0041 SB0880 [SoundBlaster X-Fi Titanium PCI-e] 4001 SB Audigy FireWire Port 1102 0010 SB Audigy FireWire Port 7002 SB Live! Game Port @@ -7868,6 +8073,7 @@ 0010 0001 IEEE 1394 4port DCST 1394-3+1B 1025 005a TravelMate 290 103c 2a20 Pavilion t3030.de Desktop PC + 103c 2a3b Media Center PC m7590n 1043 808a A8V/A8N/P4P800 series motherboard 1043 81fe M4A series motherboard 1458 1000 GA-7VT600-1394 Motherboard @@ -8078,6 +8284,7 @@ 3409 VX855/VX875 DRAM Bus Control 3410 VX900 DRAM Bus Control 19da a179 ZBOX nano VD01 + 3432 VL80x xHCI USB 3.0 Controller 4149 VIA VT6420 (ATA133) Controller 4204 K8M800 Host Bridge 4208 PT890 Host Bridge @@ -8122,6 +8329,7 @@ 5410 VX900 APIC and Central Traffic Control 6100 VT85C100A [Rhine II] 6287 SATA RAID Controller + 6290 K8M890CE Host Bridge 6327 P4M890 Security Device 6353 VX800/VX820 Scratch Registers 6364 CN896/VN896/P4M900 Security Device @@ -9377,6 +9585,8 @@ 4000 DL2000-based Gigabit Ethernet 4001 DGE-550SX PCI-X Gigabit Ethernet Adapter 4300 DGE-528T Gigabit Ethernet Adapter +# rev. B1; RealTek RTL8168E. + 1186 4b10 DGE-560T PCI Express (x1) Gigabit Ethernet Adapter 4302 DGE-530T Gigabit Ethernet Adapter (rev.C1) [Realtek RTL8169] # There are at least 3 revisions of this adapter; 4800 is board revision A1 as far as I can tell, revision B1 is 4c00. 4800 DGE-530T Gigabit Ethernet Adapter (rev 11) @@ -9570,6 +9780,7 @@ 4353 88E8039 PCI-E Fast Ethernet Controller 104d 902d VAIO VGN-NR120E 4354 88E8040 PCI-E Fast Ethernet Controller + 144d c072 Notebook N150P 4355 88E8040T PCI-E Fast Ethernet Controller 1179 ff50 Satellite P305D-S8995E 4356 88EC033 PCI-E Fast Ethernet Controller @@ -9851,7 +10062,9 @@ 5802 USS-312 USB Controller 5803 USS-344S USB Controller 5811 FW322/323 [TrueFire] 1394a Controller - 1043 8294 IEEE 1394a Firewire Controller + 103c 2a34 Pavilion a1677c + 103c 2a9e Pavilion p6310f + 1043 8294 LSI FW322/323 IEEE 1394a FireWire Controller 8086 524c D865PERL mainboard dead 0800 FireWire Host Bus Adapter 5901 FW643 [TrueFire] PCIe 1394b Controller @@ -10029,6 +10242,7 @@ 0805 RocketPort UPCI 8 port w/octa cable 080c RocketModem III 8 port 080d RocketModem III 4 port + 0810 RocketPort UPCI Plus 4 port RS232 0811 RocketPort UPCI Plus 8 port RS232 0812 RocketPort UPCI Plus 8 port RS422 0903 RocketPort Compact PCI 16 port w/external I/F @@ -10314,7 +10528,8 @@ 5201 PCI-2000 1257 Vertex Networks, Inc. 1258 Gilbarco, Inc. -1259 Allied Telesyn International +# nee Allied Telesyn International +1259 Allied Telesis 2560 AT-2560 Fast Ethernet Adapter (i82557B) 2801 AT-2801FX (RTL-8139) a117 RTL81xx Fast Ethernet @@ -10354,6 +10569,7 @@ 125d 1989 ESS Modem 1998 ES1983S Maestro-3i PCI Audio Accelerator 1028 00b1 Latitude C600 + 1028 00e5 Latitude C810 1028 00e6 ES1983S Maestro-3i (Dell Inspiron 8100) 1999 ES1983S Maestro-3i PCI Modem Accelerator 199a ES1983S Maestro-3i PCI Audio Accelerator @@ -10902,6 +11118,9 @@ 12d7 Biotronic SRL 12d8 Pericom Semiconductor 01a7 PI7C21P100 PCI to PCI Bridge + 400a PI7C9X442SL PCI Express Bridge Port + 400e PI7C9X442SL USB OHCI Controller + 400f PI7C9X442SL USB EHCI Controller 71e2 PI7C7300A/PI7C7300D PCI-to-PCI Bridge 71e3 PI7C7300A/PI7C7300D PCI-to-PCI Bridge (Secondary Bus 2) 8140 PI7C8140A PCI-to-PCI Bridge @@ -11069,6 +11288,7 @@ 0067 PCI-DAS6070 0068 PCI-DAS6071 006f PCI-DAS6036 + 0070 PCI-DAC6702 0078 PCI-DAS6013 0079 PCI-DAS6014 0115 PCIe-DAS1602/16 @@ -11228,7 +11448,8 @@ 134f Algo System Co Ltd 1350 Systec Co. Ltd 1351 Sonix Inc -1353 Thales Idatys +# nee Thales Idatys +1353 Vierling Communication SAS 0002 Proserver 0003 PCI-FUT 0004 PCI-S0 @@ -11654,7 +11875,7 @@ 13f6 ffff CMI8338/C3DX PCI Audio Device 0101 CM8338B 13f6 0101 CMI8338-031 PCI Audio Device - 0111 CM8738 + 0111 CMI8738/CMI8768 PCI Audio 1019 0970 P6STP-FL motherboard 1043 8035 CUSI-FX motherboard 1043 8077 CMI8738 6-channel audio controller @@ -11676,6 +11897,8 @@ 584d 3771 X-Mystique 7.1 LP Value 7284 8384 Striker 7.1 0211 CM8738 + 5011 CM8888 [Oxygen Express] + 13f6 5011 HDA Controller 8788 CMI8788 [Oxygen HD Audio] 1043 8269 Virtuoso 200 (Xonar D2) 1043 8275 Virtuoso 100 (Xonar DX) @@ -11700,9 +11923,7 @@ 7284 9761 CLARO 7284 9781 CLARO halo 7284 9783 eCLARO - 8828 CM8828 [Oxygen Express] - 8888 CM8888 [Oxygen Express] - 1043 84d5 ROG Xonar Phoebus + 7284 9787 CLARO II 9880 CM9880 13f7 Wildfire Communications 13f8 Ad Lib Multimedia Inc @@ -11890,6 +12111,7 @@ 153b 1151 PHASE88 16ce 1040 Edirol DA-2496 1724 VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller + 10b0 0200 Hollywood@Home 7.1 1412 1724 Albatron PX865PE 7.1 1412 3630 M-Audio Revolution 7.1 1412 3631 M-Audio Revolution 5.1 @@ -11945,6 +12167,8 @@ 9521 OX16PCI952 (Dual 16950 UART) 9523 OX16PCI952 Integrated Parallel Port c158 OXPCIe952 Dual 16C950 UART + e4bf c504 CP4-SCAT Wireless Technologies Carrier Board + e4bf d551 DU1-MUSTANG Dual-Port RS-485 Interface c308 EX-44016 16-port serial 1416 Multiwave Innovation pte Ltd 1417 Convergenet Technologies Inc @@ -11985,6 +12209,8 @@ 4008 T420-CX Unified Wire Ethernet Controller 4009 T420-BT Unified Wire Ethernet Controller 400a T404-BT Unified Wire Ethernet Controller + 400b B420-SR Unified Wire Ethernet Controller + 400c B404-BT Unified Wire Ethernet Controller 400d T480 Unified Wire Ethernet Controller 400e T440-LP-CR Unified Wire Ethernet Controller 4401 T420-CR Unified Wire Ethernet Controller @@ -11997,6 +12223,8 @@ 4408 T420-CX Unified Wire Ethernet Controller 4409 T420-BT Unified Wire Ethernet Controller 440a T404-BT Unified Wire Ethernet Controller + 440b B420-SR Unified Wire Ethernet Controller + 440c B404-BT Unified Wire Ethernet Controller 440d T480 Unified Wire Ethernet Controller 440e T440-LP-CR Unified Wire Ethernet Controller 4501 T420-CR Unified Wire Storage Controller @@ -12009,6 +12237,8 @@ 4508 T420-CX Unified Wire Storage Controller 4509 T420-BT Unified Wire Storage Controller 450a T404-BT Unified Wire Storage Controller + 450b B420-SR Unified Wire Ethernet Controller + 450c B404-BT Unified Wire Ethernet Controller 450d T480 Unified Wire Storage Controller 450e T440-LP-CR Unified Wire Storage Controller 4601 T420-CR Unified Wire Storage Controller @@ -12021,6 +12251,8 @@ 4608 T420-CX Unified Wire Storage Controller 4609 T420-BT Unified Wire Storage Controller 460a T404-BT Unified Wire Storage Controller + 460b B420-SR Unified Wire Ethernet Controller + 460c B404-BT Unified Wire Ethernet Controller 460d T480 Unified Wire Storage Controller 460e T440-LP-CR Unified Wire Storage Controller 4701 T420-CR Unified Wire Ethernet Controller @@ -12033,6 +12265,8 @@ 4708 T420-CX Unified Wire Ethernet Controller 4709 T420-BT Unified Wire Ethernet Controller 470a T404-BT Unified Wire Ethernet Controller + 470b B420-SR Unified Wire Ethernet Controller + 470c B404-BT Unified Wire Ethernet Controller 470d T480 Unified Wire Ethernet Controller 470e T440-LP-CR Unified Wire Ethernet Controller 4801 T420-CR Unified Wire Ethernet Controller @@ -12045,6 +12279,8 @@ 4808 T420-CX Unified Wire Ethernet Controller 4809 T420-BT Unified Wire Ethernet Controller 480a T404-BT Unified Wire Ethernet Controller + 480b B420-SR Unified Wire Ethernet Controller + 480c B404-BT Unified Wire Ethernet Controller 480d T480 Unified Wire Ethernet Controller 480e T440-LP-CR Unified Wire Ethernet Controller a000 PE10K Unified Wire Ethernet Controller @@ -12300,8 +12536,6 @@ 14c1 0008 10G-PCIE-8A 14c1 0009 10G-PCIE-8A (MSI-X firmware) 14c1 000a 10G-PCIE-8B - 14c1 000b 10G-PCIE-8B2 - 14c1 000c 10G-PCIE2-8B2 8043 Myrinet 2000 Scalable Cluster Interconnect 103c 1240 Myrinet M2L-PCI64/2-3.0 LANai 7.4 (HP OEM) 14c2 DTK Computer @@ -12394,6 +12628,7 @@ 1028 01c2 Latitude D620 103c 3015 PCIe LAN on Motherboard 107b 5048 E4500 Onboard + 1259 2705 AT-2711FX 1601 NetXtreme BCM5752M Gigabit Ethernet PCI Express 1612 BCM70012 Video Decoder [Crystal HD] 1615 BCM70015 Video Decoder [Crystal HD] @@ -12417,6 +12652,9 @@ 163d NetXtreme II BCM57811 10-Gigabit Ethernet 163e NetXtreme II BCM57811 10 Gigabit Ethernet Multi Function 163f NetXtreme II BCM57811 10-Gigabit Ethernet Virtual Function + 1641 NetXtreme BCM57787 Gigabit Ethernet PCIe + 1642 NetXtreme BCM57764 Gigabit Ethernet PCIe + 1643 NetXtreme BCM5725 Gigabit Ethernet PCIe 1644 NetXtreme BCM5700 Gigabit Ethernet 1014 0277 Broadcom Vigil B5700 1000Base-T 1028 00d1 Broadcom BCM5700 @@ -12553,6 +12791,7 @@ 165f NetXtreme BCM5720 Gigabit Ethernet PCIe 1662 NetXtreme II BCM57712 10 Gigabit Ethernet 1663 NetXtreme II BCM57712 10 Gigabit Ethernet Multi Function + 1665 NetXtreme BCM5717 Gigabit Ethernet PCIe 1668 NetXtreme BCM5714 Gigabit Ethernet 103c 7039 NC324i PCIe Dual Port Gigabit Server Adapter 1669 NetXtreme 5714S Gigabit Ethernet @@ -12599,9 +12838,13 @@ 1680 NetXtreme BCM5761e Gigabit Ethernet PCIe 1681 NetXtreme BCM5761 Gigabit Ethernet PCIe 1682 NetXtreme BCM57762 Gigabit Ethernet PCIe + 1683 NetXtreme BCM57767 Gigabit Ethernet PCIe 1684 NetXtreme BCM5764M Gigabit Ethernet PCIe 1685 NetXtreme II BCM57500S Gigabit Ethernet 1686 NetXtreme BCM57766 Gigabit Ethernet PCIe + 1687 NetXtreme BCM5762 Gigabit Ethernet PCIe + 1688 NetXtreme BCM5761 10/100/1000BASE-T Ethernet + 1259 2708 AT-2712 FX # The Broadcom 57800 device has two 1Gig ports and two 10Gig ports. The subsystem information can be used to differentiate. 168a NetXtreme II BCM57800 1/10 Gigabit Ethernet 1028 1f5c BCM57800 10-Gigabit Ethernet @@ -12610,6 +12853,7 @@ 1028 1f68 BCM57800 1-Gigabit Ethernet 168d NetXtreme II BCM57840 10/20 Gigabit Ethernet 168e NetXtreme II BCM57810 10 Gigabit Ethernet + 103c 1798 Flex-10 10Gb 2-port 530FLB Adapter [Meru] 1690 NetXtreme BCM57760 Gigabit Ethernet PCIe 1691 NetLink BCM57788 Gigabit Ethernet PCIe 1028 04aa XPS 8300 @@ -12866,6 +13110,7 @@ 432d BCM4322 802.11an Wireless Network Controller 4331 BCM4331 802.11a/b/g/n 106b 00d6 AirPort Extreme + 4333 Serial (EDGE/GPRS modem part of Option GT Combo Edge) 4344 EDGE/GPRS data and 802.11b/g combo cardbus [GC89] 4353 BCM43224 802.11a/b/g/n 1028 000e Wireless 1520 Half-size Mini PCIe Card @@ -12876,6 +13121,8 @@ 4359 BCM43228 802.11a/b/g/n 1028 0011 Wireless 1530 Half-size Mini PCIe Card 103c 182c BCM943228HM4L 802.11a/b/g/n 2x2 Wi-Fi Adapter + 4365 BCM43142 802.11b/g/n + 1028 0016 Wireless 1704 802.11n + BT 4.0 4401 BCM4401 100Base-T 1025 0035 TravelMate 660 103c 08b0 tc1100 tablet @@ -13199,6 +13446,7 @@ 8852 CX23885 PCI Video and Audio Decoder 0070 8010 Hauppauge WinTV HVR-1400 ExpressCard 1461 c039 AVerTV Hybrid Express (A577) + 153b 117e Cinergy T PCIe Dual 18ac db78 FusionHDTV DVB-T Dual Express 8880 CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb 0070 c108 WinTV-HVR-4400-HD model 1278 @@ -13541,6 +13789,7 @@ 07c0 PVSCSI SCSI Controller 0801 Virtual Machine Interface 15ad 0800 Hypervisor ROM Interface + 1977 HD Audio Controller 15ae Amersham Pharmacia Biotech 15b0 Zoltrix International Ltd 15b1 Source Technology Inc @@ -13548,6 +13797,7 @@ 15b3 Mellanox Technologies 0191 MT25408 [ConnectX IB Flash Recovery] 01f6 MT27500 Family [ConnectX-3 Flash Recovery] + 01ff MT27600 Family [Connect-IB Flash Recovery] 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1004 MT27500 Family [ConnectX-3 Virtual Function] @@ -13563,6 +13813,12 @@ 100e MT27551 Family 100f MT27560 Family 1010 MT27561 Family + 1011 MT27600 [Connect-IB] + 1012 MT27600 Family [Connect-IB Virtual Function] + 1013 MT27620 Family + 1014 MT27621 Family + 1015 MT27630 Family + 1016 MT27631 Family 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost 5a45 MT23108 [Infinihost HCA Flash Recovery] @@ -13998,12 +14254,14 @@ 002d AR9227 Wireless Network Adapter 002e AR9287 Wireless Network Adapter (PCI-Express) 0030 AR9300 Wireless LAN adaptor - 103c 1627 HB112AGN 802.11abgn 3x3 Wi-Fi Adapter + 103c 1627 AR9380/HB112 802.11abgn 3×3 Wi-Fi Adapter 1a56 2000 Killer Wireless-N 1102 Half-size Mini PCIe Card [AR9382] 1a56 2001 Killer Wireless-N 1103 Half-size Mini PCIe Card [AR9380] 0032 AR9485 Wireless Network Adapter + 103c 1838 AR9485/HB125 802.11bgn 1×1 Wi-Fi Adapter 0033 AR9580 Wireless Network Adapter 0034 AR9462 Wireless Network Adapter + 0036 AR9565 Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] 1014 AR5212 802.11abg NIC 1014 058a ThinkPad 11a/b/g Wireless LAN Mini Express Adapter (AR5BXB6) @@ -14103,6 +14361,10 @@ 5807 XMC-SLX150: Reconfigurable Spartan-6 FPGA with plug-in I/O 5808 XMC-SLX150-1M: Reconfigurable Spartan-6 FPGA with plug-in I/O 5901 APCe8650 PCI Express IndustryPack Carrier Card + 6301 XMC Module with user-configurable Virtex-6 FPGA, 240k logic cells, SFP front I/O + 6302 XMC Module with user-configurable Virtex-6 FPGA, 365k logic cells, SFP front I/O + 6303 XMC Module with user-configurable Virtex-6 FPGA, 240k logic cells, no front I/O + 6304 XMC Module with user-configurable Virtex-6 FPGA, 365k logic cells, no front I/O 16da Advantech Co., Ltd. 0011 INES GPIB-PCI 16df PIKA Technologies Inc. @@ -14381,7 +14643,7 @@ 1799 700e F5D7000 v6000 Wireless G Desktop Card 1799 701e F5D7010 v6000 Wireless G Notebook Card 17f9 0012 AWLC3026T 802.11g Wireless CardBus Adapter - 1814 2561 EW-7108PCg + 1814 2561 EW-7108PCg/EW-7128g 0302 RT2561/RT61 rev B 802.11g 1186 3a71 DWA-510 Wireless G Desktop Adapter 1186 3c08 AirPlus G DWL-G630 Wireless Cardbus Adapter (rev.E2) @@ -14408,7 +14670,9 @@ 13bd 1057 GN-WS32L-RH Half-size Mini PCIe Card 3091 RT3091 Wireless 802.11n 1T/2R PCIe 3092 RT3092 Wireless 802.11n 2T/2R PCIe - 3592 RT3592 Wireless 802.11an 2T/2R PCIe + 3290 RT3290 Wireless 802.11n 1T/1R PCIe + 3298 RT3290 Bluetooth + 3592 RT3592 Wireless 802.11abgn 2T/2R PCIe 5360 RT5360 Wireless 802.11n 1T/1R 1186 3c05 DWA-525 Wireless N 150 Desktop Adapter (rev.A2) 20f4 703a TEW-703PI N150 Wireless PCI Adapter @@ -14513,7 +14777,6 @@ 18ca XGI Technology Inc. (eXtreme Graphics Innovation) 0020 Z7/Z9 (XG20 core) 0021 Z9s/Z9m (XG21 core) -# duh! Device name, not my name :) 0027 Z11/Z11M 0040 Volari V3XT/V5/V8 0047 Volari 8300 (chip: XP10, codename: XG47) @@ -14580,7 +14843,7 @@ 18f1 Spectrum GmbH 18f4 Napatech A/S 0031 NT20X Network Adapter - 0051 NT20-X Capture Card + 0051 NT20X Capture Card 0061 NT20E Capture Card 0064 NT20E Inline Card 0071 NT4E Capture Card @@ -14589,34 +14852,42 @@ 0091 NT20X Capture Card [New Rev] 00a1 NT4E-STD Capture Card 00a4 NT4E-STD Inline Card +# 8 x 1 Gbps / 10 Gbps PCIe Optical Bypass Adapter + 00b1 NTBPE Optical Bypass Adapter 00c5 NT20E2 Network Adapter 2x10Gb 00d5 NT40E2-4 Network Adapter 4x10Gb 00e5 NT40E2-1 Network Adapter 1x40Gb +# 4-Port Adapter for 1 GbE In-Line Bypass Applications + 00f5 NT4E2-4T-BP Network Adapter 4x1Gb with Electrical Bypass 18f6 NextIO 1000 [Nexsis] Switch Virtual P2P PCIe Bridge 1050 [Nexsis] Switch Virtual P2P PCI Bridge 2000 [Nexsis] Switch Integrated Mgmt. Endpoint 18f7 Commtech, Inc. - 0001 Fastcom ESCC-PCI-335 - 0002 Fastcom 422/4-PCI-335 - 0003 Fastcom 232/4-1M-PCI - 0004 Fastcom 422/2-PCI-335 - 0005 Fastcom IGESCC-PCI-ISO/1 - 000a Fastcom 232/4-PCI-335 - 000b Fastcom 232/8-PCI-335 Async 8-Port RS-232 Serial PCI Adapter - 000f Fastcom FSCC - 0010 Fastcom GSCC -# Dual Serocco - 0011 Fastcom QSSB - 0014 SuperFSCC - 0015 SuperFSCC-104 - 0016 Fastcom FSCC-232 Sync/Async 2-Port RS-232 Serial PCI Adapter (F-Core) - 0017 SuperFSCC-104-NOUART - 0018 Fastcom SuperFSCC/4 Sync/Async 4-Port RS-422 Serial PCI Adapter with DMA (F-Core) - 0019 SuperFSCC with soft UARTs - 001a Fastcom SuperFSCC-104-LVDS Sync/Async 2-Port RS-644 Serial PC/104+ Adapter with DMA (F-Core) - 001b Fastcom FSCC/4 Sync/Async 4-Port RS-422 Serial PCI Adapter (F-Core) - 001c Fastcom SuperFSCC/4-LVDSSync/Async 4-Port RS-644 Serial PCI Adapter with DMA (F-Core) + 0001 ESCC-PCI-335 Serial PCI Adapter [Fastcom] + 0002 422/4-PCI-335 Serial PCI Adapter [Fastcom] + 0003 232/4-1M-PCI Serial PCI Adapter [Fastcom] + 0004 422/2-PCI-335 Serial PCI Adapter [Fastcom] + 0005 IGESCC-PCI-ISO/1 Serial PCI Adapter [Fastcom] + 000a 232/4-PCI-335 Serial PCI Adapter [Fastcom] + 000b 232/8-PCI-335 Serial PCI Adapter [Fastcom] + 000f FSCC Serial PCI Adapter [Fastcom] + 0010 GSCC Serial PCI Adapter [Fastcom] + 0011 QSSB Serial PCI Adapter [Fastcom] + 0014 SuperFSCC Serial PCI Adapter [Fastcom] + 0015 SuperFSCC-104 Serial PCI/104+ Adapter [Fastcom] + 0016 FSCC-232 RS-232 Serial PCI Adapter [Fastcom] +# Synchronous Only + 0017 SuperFSCC-104-NOUART Serial PCI/104+ Adapter [Fastcom] + 0018 SuperFSCC/4 Serial PCI Adapter [Fastcom] + 0019 SuperFSCC Serial PCI Adapter [Fastcom] +# RS-644 Only + 001a SuperFSCC-104-LVDS Serial PC/104+ Adapter [Fastcom] + 001b FSCC/4 Serial PCI Adapter [Fastcom] +# RS-644 Only + 001c SuperFSCC/4-LVDS Serial PCI Adapter [Fastcom] + 0020 422/4-PCIe Serial PCIe Adapter [Fastcom] + 0021 422/8-PCIe Serial PCIe Adapter [Fastcom] 18fb Resilience Corporation 1904 Hangzhou Silan Microelectronics Co., Ltd. 2031 SC92031 PCI Fast Ethernet Adapter @@ -14627,6 +14898,7 @@ 0011 SH7757 PCIe End-Point [PBI] 0012 SH7757 PCIe-PCI Bridge [PPB] 0013 SH7757 PCIe Switch [PS] + 0014 uPD720201 USB 3.0 Host Controller 1919 Soltek Computer Inc. 1923 Sangoma Technologies Corp. 0040 A200/Remora FXO/FXS Analog AFT card @@ -14664,6 +14936,7 @@ 1924 5201 SFN4112F-R1 1924 5202 SFN4112F-R2 0803 SFC9020 [Solarstorm] + 1924 1201 SFA6902F-R1 SFP+ AOE Adapter 1924 6200 SFN5122F-R0 1924 6201 SFN5122F-R1 1924 6202 SFN5122F-R2 @@ -14679,6 +14952,7 @@ 1924 6501 SFN5802K-R1 1924 6511 SFN5814H-R1 1924 6521 SFN5812H-R1 + 1924 6562 SFN6832F-R2 SFP+ Mezzanine Adapter 1924 6a05 SFN5112F-R5 1924 6a06 SFN5112F-R6 1924 7206 SFN5162F-R6 @@ -14710,6 +14984,7 @@ 1924 0304 SFE4003-A4 1924 0500 SFE4005-A0 c101 EF1-21022T [EtherFabric] +192a BiTMICRO Networks Inc. 192e TransDimension 1931 Option N.V. 000c Qualcomm MSM6275 UMTS chip @@ -14833,13 +15108,14 @@ 1062 AR8132 Fast Ethernet 1063 AR8131 Gigabit Ethernet 1458 e000 GA-G31M-ES2L Motherboard - 1066 L2c Gigabit Ethernet - 1067 L1c Gigabit Ethernet + 1066 Attansic L2c Gigabit Ethernet + 1067 Attansic L1c Gigabit Ethernet 1073 AR8151 v1.0 Gigabit Ethernet 1083 AR8151 v2.0 Gigabit Ethernet 1090 AR8162 Fast Ethernet 1091 AR8161 Gigabit Ethernet - 2048 L2 Fast Ethernet + 1043 1477 N56VZ + 2048 Attansic L2 Fast Ethernet 2060 AR8152 v1.1 Fast Ethernet 2062 AR8152 v2.0 Fast Ethernet 196a Sensory Networks Inc. @@ -14985,9 +15261,27 @@ 0200 TILE-Gx36 processor 1a4a SLAC National Accelerator Lab PPA-REG 1000 MCOR Power Supply Controller + 1010 AMC EVR - Stockholm Timing Board 2000 PGPCard - 4 Lane 2010 PCI-Express EVR 1a51 Hectronic AB +1a55 Rohde & Schwarz DVS GmbH + 0010 SDStationOEM + 0011 SDStationOEM II + 0020 Centaurus + 0021 Centaurus II + 0022 Centaurus II LT + 0030 CLIPSTER-VPU 1.x (Hugo) + 0040 Hydra Cinema (JPEG) + 0050 CLIPSTER-VPU 2.x (DigiLab) + 0060 CLIPSTER-DCI 2.x (HydraX) + 0061 Atomix + 0062 Atomix LT + 0063 Atomix HDMI + 0064 Atomix STAN + 0065 Atomix HDMI STAN + 0070 RED Rocket + 0090 CinePlay 1a56 Bigfoot Networks, Inc. 1a57 Highly Reliable Systems 1a58 Razer USA Ltd. @@ -15006,8 +15300,7 @@ 1a78 0037 FlashMAX PCIe SSD [rev 3D] 1a78 0038 FlashMAX PCIe SSD [rev 4] 1a78 0039 FlashMAX PCIe SSD [rev 4D] - 0040 Virident FlashMAX Drive V2 - 1a78 0040 PCIe SSD [LP Z1] + 0040 FlashMAX II 1a84 Commex Technologies 0001 Vulcan SP HT6210 10-Gigabit Ethernet (rev 02) 1a88 MEN Mikro Elektronik @@ -15104,6 +15397,7 @@ 9192 88SE9172 SATA III 6Gb/s RAID Controller 91a0 88SE91A0 SATA 6Gb/s Controller 91a4 88SE9128 IDE Controller + 9230 88SE9230 PCIe SATA 6Gb/s Controller 9480 88SE9480 SAS/SATA 6Gb/s RAID controller 1b55 NetUP Inc. 2a2c Dual DVB-S2-CI card @@ -15113,9 +15407,11 @@ f1c4 Dual ASI-RX/TX-CI card 1b6f Etron Technology, Inc. 7023 EJ168 USB 3.0 Host Controller + 7052 EJ188/EJ198 USB 3.0 Host Controller 1b73 Fresco Logic 1000 FL1000G USB 3.0 Host Controller 1d5c 1000 Anker USB 3.0 Express Card + 1009 FL1009 USB 3.0 Host Controller 1b74 OpenVox Communication Co. Ltd. 0115 D115P/D115E Single-port E1/T1 card d130 D130P/D130E Single-port E1/T1 card (3rd GEN) @@ -15128,6 +15424,8 @@ 1b96 Western Digital 1b9a XAVi Technologies Corp. 1bad ReFLEX CES +1bb0 SimpliVity Corporation + 0002 OmniCube Accelerator OA-3000 1bb3 Bluecherry 4304 BC-04120A MPEG4 4 port video encoder / decoder 4309 BC-08240A MPEG4 4 port video encoder / decoder @@ -15141,6 +15439,7 @@ 1bb5 Quantenna Communications, Inc. 1bbf Maxeler Technologies Ltd. 0003 MAX3 + 0004 MAX4 1bf4 VTI Instruments Corporation 1c1c Symphony 0001 82C101 @@ -15153,6 +15452,7 @@ 8000 8000 Storage IO Controller 1c7f Elektrobit Austria GmbH 5100 EB5100 +1c8a TSF5 Corporation 1d44 DPT a400 PM2x24/PM3224 1d5c Fantasia Trading LLC @@ -15768,13 +16068,13 @@ 004b Core Processor Secondary PCI Express Root Port 0050 Core Processor Thermal Management Controller 0069 Core Processor DRAM Controller - 0082 Centrino Advanced-N 6205 + 0082 Centrino Advanced-N 6205 [Taylor Peak] 8086 1301 Centrino Advanced-N 6205 AGN 8086 1306 Centrino Advanced-N 6205 ABG 8086 1307 Centrino Advanced-N 6205 BG 8086 1321 Centrino Advanced-N 6205 AGN 8086 1326 Centrino Advanced-N 6205 ABG - 0083 Centrino Wireless-N 1000 + 0083 Centrino Wireless-N 1000 [Condor Peak] 8086 1205 Centrino Wireless-N 1000 BGN 8086 1206 Centrino Wireless-N 1000 BG 8086 1225 Centrino Wireless-N 1000 BGN @@ -15783,35 +16083,35 @@ 8086 1306 Centrino Wireless-N 1000 BG 8086 1325 Centrino Wireless-N 1000 BGN 8086 1326 Centrino Wireless-N 1000 BG - 0084 Centrino Wireless-N 1000 + 0084 Centrino Wireless-N 1000 [Condor Peak] 8086 1215 Centrino Wireless-N 1000 BGN 8086 1216 Centrino Wireless-N 1000 BG 8086 1315 Centrino Wireless-N 1000 BGN 8086 1316 Centrino Wireless-N 1000 BG - 0085 Centrino Advanced-N 6205 + 0085 Centrino Advanced-N 6205 [Taylor Peak] 8086 1311 Centrino Advanced-N 6205 AGN 8086 1316 Centrino Advanced-N 6205 ABG - 0087 Centrino Advanced-N + WiMAX 6250 + 0087 Centrino Advanced-N + WiMAX 6250 [Kilmer Peak] 8086 1301 Centrino Advanced-N + WiMAX 6250 2x2 AGN 8086 1306 Centrino Advanced-N + WiMAX 6250 2x2 ABG 8086 1321 Centrino Advanced-N + WiMAX 6250 2x2 AGN 8086 1326 Centrino Advanced-N + WiMAX 6250 2x2 ABG - 0089 Centrino Advanced-N + WiMAX 6250 + 0089 Centrino Advanced-N + WiMAX 6250 [Kilmer Peak] 8086 1311 Centrino Advanced-N + WiMAX 6250 2x2 AGN 8086 1316 Centrino Advanced-N + WiMAX 6250 2x2 ABG - 008a Centrino Wireless-N 1030 + 008a Centrino Wireless-N 1030 [Rainbow Peak] 8086 5305 Centrino Wireless-N 1030 BGN 8086 5307 Centrino Wireless-N 1030 BG 8086 5325 Centrino Wireless-N 1030 BGN 8086 5327 Centrino Wireless-N 1030 BG - 008b Centrino Wireless-N 1030 + 008b Centrino Wireless-N 1030 [Rainbow Peak] 8086 5315 Centrino Wireless-N 1030 BGN 8086 5317 Centrino Wireless-N 1030 BG - 0090 Centrino Advanced-N 6230 + 0090 Centrino Advanced-N 6230 [Rainbow Peak] 8086 5211 Centrino Advanced-N 6230 AGN 8086 5215 Centrino Advanced-N 6230 BGN 8086 5216 Centrino Advanced-N 6230 ABG - 0091 Centrino Advanced-N 6230 + 0091 Centrino Advanced-N 6230 [Rainbow Peak] 8086 5201 Centrino Advanced-N 6230 AGN 8086 5205 Centrino Advanced-N 6230 BGN 8086 5206 Centrino Advanced-N 6230 ABG @@ -15848,8 +16148,13 @@ 1028 04cc Vostro 3350 0150 Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller 0151 Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port + 1043 1477 N56VZ 0152 Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller + 0153 3rd Gen Core Processor Thermal Subsystem + 1043 1517 Zenbook Prime UX31A 0154 3rd Gen Core processor DRAM Controller + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 0155 Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port 0156 3rd Gen Core processor Graphics Controller 0158 Xeon E3-1200 v2/Ivy Bridge DRAM Controller @@ -15860,14 +16165,18 @@ 015e Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller 0162 Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller 0166 3rd Gen Core processor Graphics Controller + 1043 1517 Zenbook Prime UX31A + 1043 2103 N56VZ 016a Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller 0172 Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller 0176 3rd Gen Core processor Graphics Controller 0309 80303 I/O Processor PCI-to-PCI Bridge 030d 80312 I/O Companion Chip PCI-to-PCI Bridge 0326 6700/6702PXH I/OxAPIC Interrupt Controller A + 103c 3208 ProLiant DL140 G2 1775 1100 CR11/VR11 Single Board Computer 0327 6700PXH I/OxAPIC Interrupt Controller B + 103c 3208 ProLiant DL140 G2 1775 1100 CR11/VR11 Single Board Computer 0329 6700PXH PCI Express-to-PCI Bridge A 032a 6700PXH PCI Express-to-PCI Bridge B @@ -15892,7 +16201,7 @@ 0412 Haswell Integrated Graphics Controller 0416 Haswell Integrated Graphics Controller 041a Haswell Integrated Graphics Controller - 0436 DH89xxCC Gigabit SGMII Connection + 0436 DH8900CC Null Device 0438 DH8900CC Series Gigabit Network Connection 043a DH8900CC Series Gigabit Fiber Network Connection 043c DH8900CC Series Gigabit Backplane Network Connection @@ -16015,6 +16324,12 @@ 0960 80960RP (i960RP) Microprocessor/Bridge 0962 80960RM (i960RM) Bridge 0964 80960RP (i960RP) Microprocessor/Bridge + 0a04 Haswell-ULT DRAM Controller + 0a06 Haswell-ULT Integrated Graphics Controller + 0a16 Haswell-ULT Integrated Graphics Controller + 0a22 Haswell-ULT Integrated Graphics Controller + 0a26 Haswell-ULT Integrated Graphics Controller + 0a2a Haswell-ULT Integrated Graphics Controller 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be2 Atom Processor D2xxx/N2xxx Integrated Graphics Controller @@ -16072,8 +16387,19 @@ 0c7d Centerton Internal Fabric 0c7e Centerton Internal Fabric 0c7f Centerton Internal Fabric + 0d00 Crystal Well DRAM Controller + 0d01 Crystal Well PCI Express x16 Controller + 0d04 Crystal Well DRAM Controller + 0d05 Crystal Well PCI Express x8 Controller + 0d09 Crystal Well PCI Express x4 Controller + 0d0c Crystal Well HD Audio Controller + 0d16 Crystal Well Integrated Graphics Controller + 0d26 Crystal Well Integrated Graphics Controller + 0d36 Crystal Well Integrated Graphics Controller 0e00 Ivytown DMI2 0e01 Ivytown PCI Express Root Port in DMI2 Mode + 0e02 Ivytown PCI Express Root Port 1a + 0e03 Ivytown PCI Express Root Port 1b 0e04 Ivytown PCI Express Root Port 2a 0e05 Ivytown PCI Express Root Port 2b 0e06 Ivytown PCI Express Root Port 2c @@ -16184,6 +16510,85 @@ 0efb Ivytown DDRIO 0efc Ivytown DDRIO 0efd Ivytown DDRIO + 0f00 ValleyView SSA-CUnit + 0f01 ValleyView SSA-CUnit + 0f02 ValleyView SSA-CUnit + 0f03 ValleyView SSA-CUnit + 0f04 ValleyView High Definition Audio Controller + 0f05 ValleyView High Definition Audio Controller + 0f06 ValleyView LPIO1 DMA Controller + 0f07 ValleyView LPIO1 DMA Controller + 0f08 ValleyView LPIO1 PWM Controller + 0f09 ValleyView LPIO1 PWM Controller + 0f0a ValleyView LPIO1 HSUART Controller #1 + 0f0b ValleyView LPIO1 HSUART Controller #1 + 0f0c ValleyView LPIO1 HSUART Controller #2 + 0f0d ValleyView LPIO1 HSUART Controller #2 + 0f0e ValleyView LPIO1 SPI Controller + 0f0f ValleyView LPIO1 SPI Controller + 0f10 ValleyView LPIO1 Controller + 0f11 ValleyView LPIO1 Controller + 0f12 ValleyView SMBus Controller + 0f13 ValleyView SMBus Controller + 0f14 ValleyView SDIO Controller + 0f15 ValleyView SDIO Controller + 0f16 ValleyView SDIO Controller + 0f17 ValleyView SDIO Controller + 0f18 ValleyView SEC + 0f19 ValleyView SEC + 0f1a ValleyView SEC + 0f1b ValleyView SEC + 0f1c ValleyView Power Control Unit + 0f1d ValleyView Power Control Unit + 0f1e ValleyView Power Control Unit + 0f1f ValleyView Power Control Unit + 0f20 ValleyView 4-Port SATA Storage Controller + 0f21 ValleyView 4-Port SATA Storage Controller + 0f22 ValleyView 6-Port SATA AHCI Controller + 0f23 ValleyView 6-Port SATA AHCI Controller + 0f24 ValleyView SATA RAID Storage Controller + 0f25 ValleyView SATA RAID Storage Controller + 0f26 ValleyView 2-Port SATA Storage Controller + 0f27 ValleyView 2-Port SATA Storage Controller + 0f28 ValleyView LPE Audio Controller + 0f29 ValleyView LPE Audio Controller + 0f2a ValleyView LPE Audio Controller + 0f2b ValleyView LPE Audio Controller + 0f2e ValleyView SATA RAID Storage Controller + 0f2f ValleyView SATA RAID Storage Controller + 0f30 ValleyView Gen7 + 0f31 ValleyView Gen7 + 0f32 ValleyView Gen7 + 0f33 ValleyView Gen7 + 0f34 ValleyView USB Enhanced Host Controller + 0f35 ValleyView USB xHCI Host Controller + 0f36 ValleyView USB xHCI Host Controller + 0f37 ValleyView OTG + 0f38 ValleyView ISP + 0f39 ValleyView ISP + 0f3a ValleyView ISP + 0f3b ValleyView ISP + 0f3c ValleyView ISP + 0f3d ValleyView ISP + 0f3e ValleyView ISP + 0f3f ValleyView ISP + 0f40 ValleyView LPIO2 DMA Controller + 0f41 ValleyView LPIO2 I2C Controller #1 + 0f42 ValleyView LPIO2 I2C Controller #2 + 0f43 ValleyView LPIO2 I2C Controller #3 + 0f44 ValleyView LPIO2 I2C Controller #4 + 0f45 ValleyView LPIO2 I2C Controller #5 + 0f46 ValleyView LPIO2 I2C Controller #6 + 0f47 ValleyView LPIO2 I2C Controller #7 + 0f48 ValleyView PCI Express Root Port + 0f49 ValleyView PCI Express Root Port + 0f4a ValleyView PCI Express Root Port + 0f4b ValleyView PCI Express Root Port + 0f4c ValleyView PCI Express Root Port + 0f4d ValleyView PCI Express Root Port + 0f4e ValleyView PCI Express Root Port + 0f4f ValleyView PCI Express Root Port + 0f50 ValleyView MIPI-HSI Controller 1000 82542 Gigabit Ethernet Controller (Fiber) 0e11 b0df NC6132 Gigabit Ethernet Adapter (1000-SX) 0e11 b0e0 NC6133 Gigabit Ethernet Adapter (1000-LX) @@ -16599,6 +17004,7 @@ 8086 a02b Gigabit ET Quad Port Server Adapter 8086 a02c Gigabit ET Quad Port Server Adapter 10ea 82577LM Gigabit Network Connection + 1028 040a Latitude E6410 1028 040b Latitude E6510 e4bf 50c1 PC1-GROOVE 10eb 82577LC Gigabit Network Connection @@ -16627,6 +17033,7 @@ 8086 000c Ethernet X520 10GbE Dual Port KX4-KR Mezz 10f9 82599EB 10 Gigabit CX4 Dual Port Network Connection 10fb 82599EB 10-Gigabit SFI/SFP+ Network Connection + 1028 1f72 Ethernet 10G 4P X520/I350 rNDC 103c 17d0 Ethernet 10Gb 2-port 560FLR-SFP+ Adapter 103c 17d2 Ethernet 10Gb 2-port 560M Adapter 103c 17d3 Ethernet 10Gb 2-port 560SFP+ Adapter @@ -16898,7 +17305,7 @@ 1028 1f62 Intel GbE 2P I350crNDC 103c 337f Ethernet 1Gb 2-port 361i Adapter 103c 3380 Ethernet 1Gb 4-port 366i Adapter - 103c 339e Ethernet 1Gb 2-port 361T Adapter [Wharton Stony Lake] + 103c 339e Ethernet 1Gb 2-port 361T Adapter 108e 7b16 Quad Port GbE PCIe 2.0 ExpressModule, UTP 108e 7b18 Quad Port GbE PCIe 2.0 Low Profile Adapter, UTP 10a9 802a UV2-BaseIO dual-port GbE @@ -16917,9 +17324,9 @@ 8086 00a3 Ethernet Server Adapter I350-F4 8086 00a4 Ethernet Server Adapter I350-F2 1523 I350 Gigabit Backplane Connection - 103c 1784 Ethernet 1Gb 2-port 361FLB Adapter [Badger Flat] + 103c 1784 Ethernet 1Gb 2-port 361FLB Adapter 103c 18d1 Ethernet 1Gb 2-port 361FLB Adapter - 103c 339f Ethernet 1Gb 4-port 366M Adapter [Vaca Key] + 103c 339f Ethernet 1Gb 4-port 366M Adapter 8086 1f52 1GbE 4P I350 Mezz 1524 I350 Gigabit Connection 1525 82567V-4 Gigabit Network Connection @@ -16930,6 +17337,8 @@ 8086 0001 Ethernet Server Adapter I340-F4 8086 0002 Ethernet Server Adapter I340-F4 1528 Ethernet Controller 10-Gigabit X540-AT2 + 1028 1f61 Ethernet 10G 4P X540/I350 rNDC + 103c 192d 561FLR-T 2-port 10Gb Ethernet Adapter 108e 7b14 Sun Dual Port 10 GbE PCIe 2.0 ExpressModule, Base-T 108e 7b15 Sun Dual Port 10 GbE PCIe 2.0 Low Profile Adapter, Base-T 1137 00bf Ethernet Converged Network Adapter X540-T2 @@ -16941,12 +17350,29 @@ 8086 5003 Ethernet 10G 2P X540-t Adapter 1529 82599 10 Gigabit Dual Port Backplane Connection with FCoE 152a 82599 10 Gigabit Dual port Network Connection with FCoE + 1533 I210 Gigabit Network Connection + 103c 0003 Ethernet Server Adapter I210-T1 + 8086 0001 Ethernet Server Adapter I210-T1 + 8086 0002 Ethernet Server Adapter I210-T1 + 1534 I210 Gigabit Network Connection + 1536 I210 Gigabit Fiber Network Connection + 1537 I210 Gigabit Backplane Connection + 1538 I210 Gigabit Network Connection + 1539 I211 Gigabit Network Connection + 153a Ethernet Connection I217-LM + 153b Ethernet Connection I217-V + 1547 DSL3510 Thunderbolt Port [Cactus Ridge] + 1549 DSL3510 Thunderbolt Controller [Cactus Ridge] 154a Ethernet Server Adapter X520-4 8086 011a Ethernet Converged Network Adapter X520-4 8086 011b Ethernet Converged Network Adapter X520-4 8086 011c Ethernet Converged Network Adapter X520-4 154d 82599EB 10-Gigabit SFP+ Network Connection 8086 7b11 10GbE 2P X520 Adapter + 1557 82599 10 Gigabit Network Connection + 1559 Ethernet Connection I218-V + 155a Ethernet Connection I218-LM + 1560 Ethernet Controller X540-AT1 1960 80960RP (i960RP) Microprocessor 101e 0431 MegaRAID 431 RAID Controller 101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller @@ -17024,6 +17450,8 @@ 1028 04b2 Vostro 3350 1028 04da Vostro 3750 1043 8418 P8P67 Deluxe Motherboard +# Realtek ALC888 audio codec + 8086 2008 DQ67SW board 8086 7270 Apple MacBookPro8,2 [Core i7, 15", 2011] 1c22 6 Series/C200 Series Chipset Family SMBus Controller 1028 04aa XPS 8300 @@ -17165,6 +17593,8 @@ 1e01 7 Series Chipset Family 4-port SATA Controller [IDE mode] 1e02 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] 1e03 7 Series Chipset Family 6-port SATA Controller [AHCI mode] + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e04 7 Series/C210 Series Chipset Family SATA Controller [RAID mode] 1e05 7 Series Chipset SATA Controller [RAID mode] 1e06 7 Series/C210 Series Chipset Family SATA Controller [RAID mode] @@ -17173,22 +17603,40 @@ 1e09 7 Series Chipset Family 2-port SATA Controller [IDE mode] 1e0e 7 Series/C210 Series Chipset Family SATA Controller [RAID mode] 1e10 7 Series/C210 Series Chipset Family PCI Express Root Port 1 + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e12 7 Series/C210 Series Chipset Family PCI Express Root Port 2 + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e14 7 Series/C210 Series Chipset Family PCI Express Root Port 3 1e16 7 Series/C210 Series Chipset Family PCI Express Root Port 4 + 1043 1477 N56VZ 1e18 7 Series/C210 Series Chipset Family PCI Express Root Port 5 1e1a 7 Series/C210 Series Chipset Family PCI Express Root Port 6 1e1c 7 Series/C210 Series Chipset Family PCI Express Root Port 7 1e1e 7 Series/C210 Series Chipset Family PCI Express Root Port 8 1e20 7 Series/C210 Series Chipset Family High Definition Audio Controller + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e22 7 Series/C210 Series Chipset Family SMBus Controller + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e24 7 Series/C210 Series Chipset Family Thermal Management Controller + 1043 1517 Zenbook Prime UX31A 1e25 7 Series/C210 Series Chipset Family DMI to PCI Bridge 1e26 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e2d 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e31 7 Series/C210 Series Chipset Family USB xHCI Host Controller + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e33 7 Series/C210 Series Chipset Family LAN Controller 1e3a 7 Series/C210 Series Chipset Family MEI Controller #1 + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e3b 7 Series/C210 Series Chipset Family MEI Controller #2 1e3c 7 Series/C210 Series Chipset Family IDE-r Controller 1e3d 7 Series/C210 Series Chipset Family KT Controller @@ -17217,6 +17665,8 @@ 1e57 HM77 Express Chipset LPC Controller 1e58 UM77 Express Chipset LPC Controller 1e59 HM76 Express Chipset LPC Controller + 1043 1477 N56VZ + 1043 1517 Zenbook Prime UX31A 1e5a 7 Series Chipset Family LPC Controller 1e5b UM77 Express Chipset LPC Controller 1e5c 7 Series Chipset Family LPC Controller @@ -17320,7 +17770,6 @@ 104d 80df Vaio PCG-FX403 2448 82801 Mobile PCI Bridge 1028 040b Latitude E6510 -# (rev d3) (prog-if (rev d3) (prog-if 01 [Subtractive decode]) 103c 0934 HP Compaq nw8240 Mobile Workstation 103c 099c NX6110/NC6120 103c 309f Compaq nx9420 Notebook @@ -17328,6 +17777,7 @@ 103c 30c1 Compaq 6910p 104d 902d VAIO VGN-NR120E 144d c00c P30 notebook + 144d c072 Notebook N150P 1734 1055 Amilo M1420 17aa 20ae ThinkPad T61 e4bf cc47 CCG-RUMBA @@ -17384,6 +17834,7 @@ 1028 0211 Optiplex 755 1028 02da OptiPlex 980 103c 2a3b Pavilion A1512X + 103c 31fe ProLiant DL140 G3 103c 330b ProLiant ML150 G6 Server 1458 5000 GA-EP45-DS5 Motherboard 1775 11cc CC11/CL11 @@ -17648,6 +18099,7 @@ 1028 0169 Precision 470 1028 019a PowerEdge SC1425 103c 12bc d530 CMT (DG746A) + 103c 3208 ProLiant DL140 G2 1043 80a6 P4P800 series motherboard 1458 24d1 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -17669,6 +18121,7 @@ 1028 019a PowerEdge SC1425 103c 006a NX9500 103c 12bc d530 CMT (DG746A) + 103c 3208 ProLiant DL140 G2 1043 80a6 P4P800/P5P800 series motherboard 1458 24d2 GA-8IPE1000/8KNXP motherboard 1462 7280 865PE Neo2 (MS-6728) @@ -17685,6 +18138,7 @@ 1028 0156 Precision 360 1028 0169 Precision 470 103c 12bc d330 uT + 103c 3208 ProLiant DL140 G2 1043 80a6 P4P800/P5P800 series motherboard 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -17707,6 +18161,7 @@ 1028 019a PowerEdge SC1425 103c 006a NX9500 103c 12bc d530 CMT (DG746A) + 103c 3208 ProLiant DL140 G2 1043 80a6 P4P800/P5P800 series motherboard 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -17790,6 +18245,7 @@ 1028 019a PowerEdge SC1425 103c 006a NX9500 103c 12bc d530 CMT (DG746A) + 103c 3208 ProLiant DL140 G2 1043 80a6 P4P800/P5P800 series motherboard 1458 5006 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -18000,18 +18456,23 @@ 25e7 5000 Series Chipset PCI Express x4 Port 7 25f0 5000 Series Chipset FSB Registers 1028 01bb PowerEdge 1955 FSB Registers + 103c 31fd ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 25f1 5000 Series Chipset Reserved Registers + 103c 31fd ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 25f3 5000 Series Chipset Reserved Registers + 103c 31fd ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 25f5 5000 Series Chipset FBD Registers + 103c 31fd ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 25f6 5000 Series Chipset FBD Registers + 103c 31fd ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 25f7 5000 Series Chipset PCI Express x8 Port 2-3 @@ -18210,10 +18671,12 @@ e4bf 0cd3 CD3-JIVE e4bf 58b1 XB1 2670 631xESB/632xESB/3100 Chipset LPC Interface Controller + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 2680 631xESB/632xESB/3100 Chipset SATA IDE Controller 2681 631xESB/632xESB SATA AHCI Controller + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 2682 631xESB/632xESB SATA RAID Controller @@ -18222,15 +18685,18 @@ 2688 631xESB/632xESB/3100 Chipset UHCI USB Controller #1 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 2689 631xESB/632xESB/3100 Chipset UHCI USB Controller #2 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 268a 631xESB/632xESB/3100 Chipset UHCI USB Controller #3 1028 01f0 PowerEdge R900 onboard USB + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 268b 631xESB/632xESB/3100 Chipset UHCI USB Controller #4 @@ -18240,19 +18706,24 @@ 268c 631xESB/632xESB/3100 Chipset EHCI USB2 Controller 1028 01bb PowerEdge 1955 onboard USB 1028 01f0 PowerEdge R900 onboard USB + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 2690 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 + 103c 31fe ProLiant DL140 G3 2692 631xESB/632xESB/3100 Chipset PCI Express Root Port 2 + 103c 31fe ProLiant DL140 G3 2694 631xESB/632xESB/3100 Chipset PCI Express Root Port 3 2696 631xESB/632xESB/3100 Chipset PCI Express Root Port 4 2698 631xESB/632xESB AC '97 Audio Controller 2699 631xESB/632xESB AC '97 Modem Controller 269a 631xESB/632xESB High Definition Audio Controller 269b 631xESB/632xESB/3100 Chipset SMBus Controller + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 8086 3476 Intel S5000PSLSATA Server Board 269e 631xESB/632xESB IDE Controller + 103c 31fe ProLiant DL140 G3 15d9 8680 X7DVL-E-O motherboard 2770 82945G/GZ/P/PL Memory Controller Hub 1028 01ad OptiPlex GX620 @@ -18327,10 +18798,11 @@ 10f7 8338 Panasonic CF-Y5 laptop 17aa 2009 ThinkPad T60/R60 series 27bc NM10 Family LPC Controller + 144d c072 Notebook N150P 8086 4f4d DeskTop Board D510MO 27bd 82801GHM (ICH7-M DH) LPC Interface Bridge 1025 006c 9814 WKMI - 27c0 N10/ICH7 Family SATA Controller [IDE mode] + 27c0 NM10/ICH7 Family SATA Controller [IDE mode] 1028 01ad OptiPlex GX620 1028 01df PowerEdge SC440 1028 01e6 PowerEdge 860 @@ -18340,9 +18812,10 @@ 1462 7236 945P Neo3-F Rev. 2.2 motherboard 1775 11cc CC11/CL11 8086 544e DeskTop Board D945GTP - 27c1 N10/ICH7 Family SATA Controller [AHCI mode] + 27c1 NM10/ICH7 Family SATA Controller [AHCI mode] 1028 01df PowerEdge SC440 103c 2a3b Pavilion A1512X + 144d c072 Notebook N150P 1775 11cc CC11/CL11 8086 4f4d DeskTop Board D510MO 8086 5842 DeskTop Board D975XBX @@ -18358,7 +18831,7 @@ 103c 30a3 Compaq nw8440 17aa 200d ThinkPad T60/R60 series 27c6 82801GHM (ICH7-M DH) SATA Controller [RAID mode] - 27c8 N10/ICH 7 Family USB UHCI Controller #1 + 27c8 NM10/ICH7 Family USB UHCI Controller #1 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18371,11 +18844,12 @@ 1043 1237 A6J-Q008 1043 8179 P5KPL-VM,P5LD2-VM Mainboard 107b 5048 E4500 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 17aa 200a ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP - 27c9 N10/ICH 7 Family USB UHCI Controller #2 + 27c9 NM10/ICH7 Family USB UHCI Controller #2 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18388,11 +18862,12 @@ 1043 1237 A6J-Q008 1043 8179 P5KPL-VM,P5LD2-VM Mainboard 107b 5048 E4500 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 17aa 200a ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP - 27ca N10/ICH 7 Family USB UHCI Controller #3 + 27ca NM10/ICH7 Family USB UHCI Controller #3 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18405,11 +18880,12 @@ 1043 1237 A6J-Q008 1043 8179 P5KPL-VM,P5LD2-VM Mainboard 107b 5048 E4500 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 17aa 200a ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP - 27cb N10/ICH 7 Family USB UHCI Controller #4 + 27cb NM10/ICH7 Family USB UHCI Controller #4 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18421,11 +18897,12 @@ 1043 1237 A6J-Q008 1043 8179 P5KPL-VM,P5LD2-VM Mainboard 107b 5048 E4500 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 17aa 200a ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP - 27cc N10/ICH 7 Family USB2 EHCI Controller + 27cc NM10/ICH7 Family USB2 EHCI Controller 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18437,24 +18914,29 @@ 103c 30a3 Compaq nw8440 1043 1237 A6J-Q008 1043 8179 P5KPL-VM,P5LD2-VM Mainboard + 144d c072 Notebook N150P 1775 11cc CC11/CL11 17aa 200b ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP - 27d0 N10/ICH 7 Family PCI Express Port 1 + 27d0 NM10/ICH7 Family PCI Express Port 1 103c 309f Compaq nx9420 Notebook 103c 30a3 Compaq nw8440 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 - 27d2 N10/ICH 7 Family PCI Express Port 2 + 27d2 NM10/ICH7 Family PCI Express Port 2 103c 309f Compaq nx9420 Notebook 103c 30a3 Compaq nw8440 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 - 27d4 N10/ICH 7 Family PCI Express Port 3 + 27d4 NM10/ICH7 Family PCI Express Port 3 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 - 27d6 N10/ICH 7 Family PCI Express Port 4 + 27d6 NM10/ICH7 Family PCI Express Port 4 103c 30a3 Compaq nw8440 + 144d c072 Notebook N150P 1775 11cc CC11/CL11 - 27d8 N10/ICH 7 Family High Definition Audio Controller + 27d8 NM10/ICH7 Family High Definition Audio Controller 1025 006c 9814 WKMI 1028 01d7 XPS M1210 103c 2a3b Pavilion A1512X @@ -18471,6 +18953,7 @@ 1179 ff10 Toshiba Satellite A100-796 audio (Realtek ALC861) 1179 ff31 AC97 Data Fax SoftModem with SmartCP 1447 1043 Asus A8JP (Analog Devices AD1986A) + 144d c072 Notebook N150P 1458 a102 GA-8I945PG-RH Mainboard 152d 0753 Softmodem 1734 10ad Conexant softmodem SmartCP @@ -18480,7 +18963,7 @@ 8086 27d8 DeskTop Board D945GTP 8086 d618 DeskTop Board D510MO 8384 7680 STAC9221 HD Audio Codec - 27da N10/ICH 7 Family SMBus Controller + 27da NM10/ICH7 Family SMBus Controller 1025 006c 9814 WKMI 1028 01ad OptiPlex GX620 1028 01d7 XPS M1210 @@ -18489,13 +18972,14 @@ 103c 2a3b Pavilion A1512X 1043 8179 P5KPL-VM Motherboard 10f7 8338 Panasonic CF-Y5 laptop + 144d c072 Notebook N150P 1458 5001 GA-8I945PG-RH Mainboard 1775 11cc CC11/CL11 17aa 200f ThinkPad T60/R60 series 8086 4f4d DeskTop Board D510MO 8086 544e DeskTop Board D945GTP 8086 5842 DeskTop Board D975XBX - 27dc N10/ICH 7 Family LAN Controller + 27dc NM10/ICH7 Family LAN Controller 103c 2a3b Pavilion A1512X 8086 308d DeskTop Board D945GTP 27dd 82801G (ICH7 Family) AC'97 Modem Controller @@ -18544,12 +19028,14 @@ 2821 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA Controller [AHCI mode] 2822 82801 SATA Controller [RAID mode] 1028 020d Inspiron 530 + 2823 Wellsburg sSATA RAID Controller 2824 82801HB (ICH8) 4 port SATA Controller [AHCI mode] 1043 81ec P5B 2825 82801HR/HO/HH (ICH8R/DO/DH) 2 port SATA Controller [IDE mode] 1028 01da OptiPlex 745 1462 7235 P965 Neo MS-7235 mainboard 2826 C600/X79 series chipset SATA RAID Controller + 2827 Wellsburg sSATA RAID Controller 2828 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [IDE mode] 1028 01f3 Inspiron 1420 103c 30c0 Compaq 6710b @@ -18586,7 +19072,6 @@ 1028 01da OptiPlex 745 1028 01f3 Inspiron 1420 103c 30c0 Compaq 6710b -# Name mistyped on previous submission 103c 30c1 Compaq 6910p 103c 30cc Pavilion dv6700 103c 30d9 Presario C700 @@ -19220,8 +19705,10 @@ 2e16 4 Series Chipset PT IDER Controller 2e17 4 Series Chipset Serial KT Controller 2e20 4 Series Chipset DRAM Controller + 1043 82d3 P5Q Deluxe Motherboard 1458 5000 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 2e21 4 Series Chipset PCI Express Root Port + 1043 82d3 P5Q Deluxe Motherboard 1458 5000 GA-EP45-DS5 Motherboard 2e22 4 Series Chipset Integrated Graphics Controller 1458 d000 GA-EG45M-DS2H Mainboard @@ -19327,40 +19814,43 @@ 340e 5520/5500/X58 I/O Hub PCI Express Root Port 7 103c 330b ProLiant ML150 G6 Server 340f 5520/5500/X58 I/O Hub PCI Express Root Port 8 - 3410 5520/5500/X58 I/O Hub PCI Express Root Port 9 - 3411 5520/5500/X58 I/O Hub PCI Express Root Port 10 - 3418 5520/5500/X58 Physical Layer Port 0 - 3419 5520/5500 Physical Layer Port 1 - 3420 5500 Non-Legacy I/O Hub PCI Express Root Port 0 - 3421 5520 Non-Legacy I/O Hub PCI Express Root Port 0 - 3422 5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers + 3410 7500/5520/5500/X58 I/O Hub PCI Express Root Port 9 + 3411 7500/5520/5500/X58 I/O Hub PCI Express Root Port 10 + 3418 7500/5520/5500/X58 Physical Layer Port 0 + 3419 7500/5520/5500 Physical Layer Port 1 + 3420 7500/5520/5500/X58 I/O Hub PCI Express Root Port 0 + 3421 7500/5520/5500/X58 I/O Hub PCI Express Root Port 0 + 3422 7500/5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers 103c 330b ProLiant G6 series - 3423 5520/5500/X58 I/O Hub Control Status and RAS Registers + 3423 7500/5520/5500/X58 I/O Hub Control Status and RAS Registers 103c 330b ProLiant G6 series - 3425 5520/5500/X58 Physical and Link Layer Registers Port 0 - 3426 5520/5500/X58 Routing and Protocol Layer Registers Port 0 - 3427 5520/5500 Physical and Link Layer Registers Port 1 - 3428 5520/5500 Routing & Protocol Layer Register Port 1 + 3425 7500/5520/5500/X58 Physical and Link Layer Registers Port 0 + 3426 7500/5520/5500/X58 Routing and Protocol Layer Registers Port 0 + 3427 7500/5520/5500 Physical and Link Layer Registers Port 1 + 3428 7500/5520/5500 Routing & Protocol Layer Register Port 1 3429 5520/5500/X58 Chipset QuickData Technology Device 342a 5520/5500/X58 Chipset QuickData Technology Device 342b 5520/5500/X58 Chipset QuickData Technology Device 342c 5520/5500/X58 Chipset QuickData Technology Device - 342d 5520/5500/X58 I/O Hub I/OxAPIC Interrupt Controller - 342e 5520/5500/X58 I/O Hub System Management Registers + 342d 7500/5520/5500/X58 I/O Hub I/OxAPIC Interrupt Controller + 342e 7500/5520/5500/X58 I/O Hub System Management Registers 103c 330b ProLiant G6 series - 342f 5520/5500/X58 Trusted Execution Technology Registers + 342f 7500/5520/5500/X58 Trusted Execution Technology Registers 3430 5520/5500/X58 Chipset QuickData Technology Device 3431 5520/5500/X58 Chipset QuickData Technology Device 3432 5520/5500/X58 Chipset QuickData Technology Device 3433 5520/5500/X58 Chipset QuickData Technology Device - 3438 5520/5500/X58 I/O Hub Throttle Registers + 3438 7500/5520/5500/X58 I/O Hub Throttle Registers 3500 6311ESB/6321ESB PCI Express Upstream Port + 103c 31fe ProLiant DL140 G3 3501 6310ESB PCI Express Upstream Port 3504 6311ESB/6321ESB I/OxAPIC Interrupt Controller 3505 6310ESB I/OxAPIC Interrupt Controller 350c 6311ESB/6321ESB PCI Express to PCI-X Bridge + 103c 31fe ProLiant DL140 G3 350d 6310ESB PCI Express to PCI-X Bridge 3510 6311ESB/6321ESB PCI Express Downstream Port E1 + 103c 31fe ProLiant DL140 G3 3511 6310ESB PCI Express Downstream Port E1 3514 6311ESB/6321ESB PCI Express Downstream Port E2 3515 6310ESB PCI Express Downstream Port E2 @@ -19447,6 +19937,7 @@ 3591 E7525/E7520 Error Reporting Registers 1014 02dd eServer xSeries server mainboard 1028 0169 Precision 470 + 103c 3208 ProLiant DL140 G2 4c53 10d0 Telum ASLP10 Processor AMC 3592 E7320 Memory Controller Hub 3593 E7320 Error Reporting Registers @@ -19540,6 +20031,7 @@ 1028 028c PowerEdge R410 LPC Interface Controller 1028 028d PowerEdge T410 LPC Interface Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5001 GA-EP45-DS5 Motherboard 3a18 82801JIB (ICH10) LPC Interface Controller 3a1a 82801JD (ICH10D) LPC Interface Controller @@ -19558,55 +20050,66 @@ 1028 028c PowerEdge R410 SATA IDE Controller 1028 028d PowerEdge T410 SATA IDE Controller 3a30 82801JI (ICH10 Family) SMBus Controller + 1043 82d4 P5Q Deluxe Motherboard 1458 5001 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a32 82801JI (ICH10 Family) Thermal Subsystem 3a34 82801JI (ICH10 Family) USB UHCI Controller #1 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5 Motherboard 3a35 82801JI (ICH10 Family) USB UHCI Controller #2 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5 Motherboard 3a36 82801JI (ICH10 Family) USB UHCI Controller #3 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5 Motherboard 3a37 82801JI (ICH10 Family) USB UHCI Controller #4 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a38 82801JI (ICH10 Family) USB UHCI Controller #5 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant ML150 G6 Server + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a39 82801JI (ICH10 Family) USB UHCI Controller #6 1028 028c PowerEdge R410 USB UHCI Controller 1028 028d PowerEdge T410 USB UHCI Controller 103c 330b ProLiant ML150 G6 Server + 1043 82d4 P5Q Deluxe Motherboard 1458 5004 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a3a 82801JI (ICH10 Family) USB2 EHCI Controller #1 1028 028c PowerEdge R410 USB EHCI Controller 1028 028d PowerEdge T410 USB EHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5006 GA-EP45-DS5 Motherboard 3a3c 82801JI (ICH10 Family) USB2 EHCI Controller #2 1028 028c PowerEdge R410 USB EHCI Controller 1028 028d PowerEdge T410 USB EHCI Controller 103c 330b ProLiant G6 series + 1043 82d4 P5Q Deluxe Motherboard 1458 5006 GA-EP45-DS5 Motherboard 3a3e 82801JI (ICH10 Family) HD Audio Controller + 1043 8311 P5Q Deluxe Motherboard 1458 a002 GA-EP45-UD3R Motherboard 1458 a102 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a40 82801JI (ICH10 Family) PCI Express Root Port 1 1028 028c PowerEdge R410 PCI Express Port 1 1028 028d PowerEdge T410 PCI Express Port 1 103c 330b ProLiant ML150 G6 Server + 1043 82d4 P5Q Deluxe Motherboard 1043 82ea P6T DeLuxe Motherboard 1458 5001 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a42 82801JI (ICH10 Family) PCI Express Port 2 @@ -19621,6 +20124,7 @@ 1458 5001 GA-EP45-DS5 Motherboard 3a4a 82801JI (ICH10 Family) PCI Express Root Port 6 103c 330b ProLiant ML150 G6 Server + 1043 82d4 P5Q Deluxe Motherboard 1043 82ea P6T DeLuxe Motherboard 1458 5001 GA-EP45-DS5/GA-EG45M-DS2H Motherboard 3a4c 82801JI (ICH10 Family) Gigabit Ethernet Controller @@ -20128,6 +20632,8 @@ 8184 Atom Processor E6xx PCI Express Port 1 8185 Atom Processor E6xx PCI Express Port 2 8186 Atom Processor E6xx LPC Bridge + 821c Wellsburg PCI Express Root Port #7 + 821d Wellsburg PCI Express Root Port #7 84c4 450KX/GX [Orion] - 82454KX/GX PCI bridge 84c5 450KX/GX [Orion] - 82453KX/GX Memory controller 84ca 450NX - 82451NX Memory & I/O Controller @@ -20169,38 +20675,38 @@ 8817 Platform Controller Hub EG20T I2C Controller 8818 Platform Controller Hub EG20T Controller Area Network (CAN) Controller 8819 Platform Controller Hub EG20T IEEE 1588 Hardware Assist - 8c00 Lynx Point 4-Port SATA IDE Controller - 8c01 Lynx Point 4-Port SATA IDE Controller - 8c02 Lynx Point 6-Port SATA AHCI Controller - 8c03 Lynx Point 6-Port SATA AHCI Controller - 8c04 Lynx Point SATA RAID Controller - 8c05 Lynx Point SATA RAID Controller - 8c06 Lynx Point SATA RAID Controller - 8c07 Lynx Point SATA RAID Controller - 8c08 Lynx Point 2-Port SATA IDE Controller - 8c09 Lynx Point 2-Port SATA IDE Controller - 8c0e Lynx Point SATA RAID Controller - 8c0f Lynx Point SATA RAID Controller - 8c10 Lynx Point PCI Express Root Port 1 - 8c11 Lynx Point PCI Express Root Port 1 - 8c12 Lynx Point PCI Express Root Port 2 - 8c13 Lynx Point PCI Express Root Port 2 - 8c14 Lynx Point PCI Express Root Port 3 - 8c15 Lynx Point PCI Express Root Port 3 - 8c16 Lynx Point PCI Express Root Port 4 - 8c17 Lynx Point PCI Express Root Port 4 - 8c18 Lynx Point PCI Express Root Port 5 - 8c19 Lynx Point PCI Express Root Port 5 - 8c1a Lynx Point PCI Express Root Port 6 - 8c1b Lynx Point PCI Express Root Port 6 - 8c1c Lynx Point PCI Express Root Port 7 - 8c1d Lynx Point PCI Express Root Port 7 - 8c1e Lynx Point PCI Express Root Port 8 - 8c1f Lynx Point PCI Express Root Port 8 - 8c20 Lynx Point HD Audio Controller - 8c21 Lynx Point HD Audio Controller + 8c00 Lynx Point 4-port SATA Controller 1 [IDE mode] + 8c01 Lynx Point 4-port SATA Controller 1 [IDE mode] + 8c02 Lynx Point 6-port SATA Controller 1 [AHCI mode] + 8c03 Lynx Point 6-port SATA Controller 1 [AHCI mode] + 8c04 Lynx Point SATA Controller 1 [RAID mode] + 8c05 Lynx Point SATA Controller 1 [RAID mode] + 8c06 Lynx Point SATA Controller 1 [RAID mode] + 8c07 Lynx Point SATA Controller 1 [RAID mode] + 8c08 Lynx Point 2-port SATA Controller 2 [IDE mode] + 8c09 Lynx Point 2-port SATA Controller 2 [IDE mode] + 8c0e Lynx Point SATA Controller 1 [RAID mode] + 8c0f Lynx Point SATA Controller 1 [RAID mode] + 8c10 Lynx Point PCI Express Root Port #1 + 8c11 Lynx Point PCI Express Root Port #1 + 8c12 Lynx Point PCI Express Root Port #2 + 8c13 Lynx Point PCI Express Root Port #2 + 8c14 Lynx Point PCI Express Root Port #3 + 8c15 Lynx Point PCI Express Root Port #3 + 8c16 Lynx Point PCI Express Root Port #4 + 8c17 Lynx Point PCI Express Root Port #4 + 8c18 Lynx Point PCI Express Root Port #5 + 8c19 Lynx Point PCI Express Root Port #5 + 8c1a Lynx Point PCI Express Root Port #6 + 8c1b Lynx Point PCI Express Root Port #6 + 8c1c Lynx Point PCI Express Root Port #7 + 8c1d Lynx Point PCI Express Root Port #7 + 8c1e Lynx Point PCI Express Root Port #8 + 8c1f Lynx Point PCI Express Root Port #8 + 8c20 Lynx Point High Definition Audio Controller + 8c21 Lynx Point High Definition Audio Controller 8c22 Lynx Point SMBus Controller - 8c23 Lynx Point CHAP Counter + 8c23 Lynx Point CHAP Counters 8c24 Lynx Point Thermal Management Controller 8c26 Lynx Point USB Enhanced Host Controller #1 8c2d Lynx Point USB Enhanced Host Controller #2 @@ -20243,6 +20749,64 @@ 8c5d Lynx Point LPC Controller 8c5e Lynx Point LPC Controller 8c5f Lynx Point LPC Controller + 8d00 Wellsburg 4-port SATA Controller [IDE mode] + 8d02 Wellsburg 6-Port SATA Controller [AHCI mode] + 8d04 Wellsburg SATA Controller [RAID mode] + 8d06 Wellsburg SATA Controller [RAID mode] + 8d08 Wellsburg 2-port SATA Controller [IDE mode] + 8d0e Wellsburg SATA Controller [RAID mode] + 8d10 Wellsburg PCI Express Root Port #1 + 8d11 Wellsburg PCI Express Root Port #1 + 8d12 Wellsburg PCI Express Root Port #2 + 8d13 Wellsburg PCI Express Root Port #2 + 8d14 Wellsburg PCI Express Root Port #3 + 8d15 Wellsburg PCI Express Root Port #3 + 8d16 Wellsburg PCI Express Root Port #4 + 8d17 Wellsburg PCI Express Root Port #4 + 8d18 Wellsburg PCI Express Root Port #5 + 8d19 Wellsburg PCI Express Root Port #5 + 8d1a Wellsburg PCI Express Root Port #6 + 8d1e Wellsburg PCI Express Root Port #8 + 8d1f Wellsburg PCI Express Root Port #8 + 8d20 Wellsburg HD Audio Controller + 8d21 Wellsburg HD Audio Controller + 8d22 Wellsburg SMBus Controller + 8d24 Wellsburg Thermal Subsystem + 8d26 Wellsburg USB Enhanced Host Controller #1 + 8d2d Wellsburg USB Enhanced Host Controller #2 + 8d31 Wellsburg USB xHCI Host Controller + 8d33 Wellsburg LAN Controller + 8d34 Wellsburg NAND Controller + 8d3a Wellsburg MEI Controller #1 + 8d3b Wellsburg MEI Controller #2 + 8d3c Wellsburg IDE-r Controller + 8d3d Wellsburg KT Controller + 8d40 Wellsburg LPC Controller + 8d41 Wellsburg LPC Controller + 8d42 Wellsburg LPC Controller + 8d43 Wellsburg LPC Controller + 8d44 Wellsburg LPC Controller + 8d45 Wellsburg LPC Controller + 8d46 Wellsburg LPC Controller + 8d47 Wellsburg LPC Controller + 8d48 Wellsburg LPC Controller + 8d49 Wellsburg LPC Controller + 8d4a Wellsburg LPC Controller + 8d4b Wellsburg LPC Controller + 8d4c Wellsburg LPC Controller + 8d4d Wellsburg LPC Controller + 8d4e Wellsburg LPC Controller + 8d4f Wellsburg LPC Controller + 8d60 Wellsburg sSATA Controller [IDE mode] + 8d62 Wellsburg sSATA Controller [AHCI mode] + 8d64 Wellsburg sSATA Controller [RAID mode] + 8d66 Wellsburg sSATA Controller [RAID mode] + 8d68 Wellsburg sSATA Controller [IDE mode] + 8d6e Wellsburg sSATA Controller [RAID mode] + 8d7c Wellsburg SPSR + 8d7d Wellsburg MS SMBus 0 + 8d7e Wellsburg MS SMBus 1 + 8d7f Wellsburg MS SMBus 2 9000 IXP2000 Family Network Processor 9001 IXP2400 Network Processor 9002 IXP2300 Network Processor @@ -20251,6 +20815,62 @@ 9622 Integrated RAID 9641 Integrated RAID 96a1 Integrated RAID + 9c00 Lynx Point-LP SATA Controller 1 [IDE mode] + 9c01 Lynx Point-LP SATA Controller 1 [IDE mode] + 9c02 Lynx Point-LP SATA Controller 1 [AHCI mode] + 9c03 Lynx Point-LP SATA Controller 1 [AHCI mode] + 9c04 Lynx Point-LP SATA Controller 1 [RAID mode] + 9c05 Lynx Point-LP SATA Controller 1 [RAID mode] + 9c06 Lynx Point-LP SATA Controller 1 [RAID mode] + 9c07 Lynx Point-LP SATA Controller 1 [RAID mode] + 9c08 Lynx Point-LP SATA Controller 2 [IDE mode] + 9c09 Lynx Point-LP SATA Controller 2 [IDE mode] + 9c0a LynxPoint-LP SATA Controller [Reserved] + 9c0b LynxPoint-LP SATA Controller [Reserved] + 9c0c LynxPoint-LP SATA Controller [Reserved] + 9c0d LynxPoint-LP SATA Controller [Reserved] + 9c0e Lynx Point-LP SATA Controller 1 [RAID mode] + 9c0f Lynx Point-LP SATA Controller 1 [RAID mode] + 9c10 Lynx Point-LP PCI Express Root Port 1 + 9c11 Lynx Point-LP PCI Express Root Port 1 + 9c12 Lynx Point-LP PCI Express Root Port 2 + 9c13 Lynx Point-LP PCI Express Root Port 2 + 9c14 Lynx Point-LP PCI Express Root Port 3 + 9c15 Lynx Point-LP PCI Express Root Port 3 + 9c16 Lynx Point-LP PCI Express Root Port 4 + 9c17 Lynx Point-LP PCI Express Root Port 4 + 9c18 Lynx Point-LP PCI Express Root Port 5 + 9c19 Lynx Point-LP PCI Express Root Port 5 + 9c1a Lynx Point-LP PCI Express Root Port 6 + 9c1b Lynx Point-LP PCI Express Root Port 6 + 9c20 Lynx Point-LP HD Audio Controller + 9c21 Lynx Point-LP HD Audio Controller + 9c22 Lynx Point-LP SMBus Controller + 9c23 Lynx Point-LP CHAP Counters + 9c24 Lynx Point-LP Thermal + 9c26 Lynx Point-LP USB EHCI #1 + 9c31 Lynx Point-LP USB xHCI HC + 9c35 Lynx Point-LP SDIO Controller + 9c36 Lynx Point-LP Audio DSP Controller + 9c3a Lynx Point-LP HECI #0 + 9c3b Lynx Point-LP HECI #1 + 9c3c Lynx Point-LP HECI IDER + 9c3d Lynx Point-LP HECI KT + 9c40 Lynx Point-LP LPC Controller + 9c41 Lynx Point-LP LPC Controller + 9c42 Lynx Point-LP LPC Controller + 9c43 Lynx Point-LP LPC Controller + 9c44 Lynx Point-LP LPC Controller + 9c45 Lynx Point-LP LPC Controller + 9c46 Lynx Point-LP LPC Controller + 9c47 Lynx Point-LP LPC Controller + 9c60 Lynx Point-LP Low Power Sub-System DMA + 9c61 Lynx Point-LP I2C Controller #0 + 9c62 Lynx Point-LP I2C Controller #1 + 9c63 Lynx Point-LP UART Controller #0 + 9c64 Lynx Point-LP UART Controller #1 + 9c65 Lynx Point-LP SPI Controller #0 + 9c66 Lynx Point-LP SPI Controller #1 a000 Atom Processor D4xx/D5xx/N4xx/N5xx DMI Bridge 8086 4f4d DeskTop Board D510MO a001 Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller @@ -20258,8 +20878,11 @@ a002 Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller a003 Atom Processor D4xx/D5xx/N4xx/N5xx CHAPS counter a010 Atom Processor D4xx/D5xx/N4xx/N5xx DMI Bridge + 144d c072 Notebook N150P a011 Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller + 144d c072 Notebook N150P a012 Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller + 144d c072 Notebook N150P a013 Atom Processor D4xx/D5xx/N4xx/N5xx CHAPS counter a620 6400/6402 Advanced Memory Buffer (AMB) b152 21152 PCI-to-PCI Bridge @@ -20767,6 +21390,8 @@ b1d9 ATCOM Technology co., LTD. # Pinnacle should be 11bd, but they got it wrong several times --mj bd11 Pinnacle Systems, Inc. (Wrong ID) bdbd Blackmagic Design +# HD/SDI input and output card for PCI Express 1x + a11b DeckLink SDI c001 TSI Telsys c0a9 Micron/Crucial Technology c0de Motorola @@ -20818,6 +21443,10 @@ dada Datapath Limited db10 Diablo Technologies dcba Dynamic Engineering 0046 PCIeAlteraCycloneIV +# VPX format Receiver Controller Board + 0047 VPX-RCB +# PMC Format FPGA design with 8 high speed UART channels + 0048 PMC-Biserial-III-BAE9 dd01 Digital Devices GmbH 0003 Octopus LE DVB adapter dead Indigita Corporation diff --git a/l4/pkg/io/server/src/Make.rules b/l4/pkg/io/server/src/Make.rules index 1b256c5cd..5a58d8c5c 100644 --- a/l4/pkg/io/server/src/Make.rules +++ b/l4/pkg/io/server/src/Make.rules @@ -26,8 +26,10 @@ REQUIRES_CFLAGS = libio-vbus libio-io PRIVATE_INCDIR += $(SRC_DIR) +ifneq ($(filter regen_files,$(MAKECMDGOALS)),) + ifneq ($(SRC_DIR),) -all:: $(SRC_DIR)/lua_glue.swg.h $(SRC_DIR)/lua_glue.swg.cc +regen_files:: $(SRC_DIR)/lua_glue.swg.h $(SRC_DIR)/lua_glue.swg.cc endif SWIG_RM_EXT_C ?= $(L4DIR)/tool/bin/swig-rm-extern-c.pl @@ -50,7 +52,7 @@ $(SRC_DIR)/%.swg.c_cc: $(SRC_DIR)/%.swg $(SRC_DIR)/Makefile $(VERBOSE)$(SWIG) $(SWIG_INCDIR) -c++ -small -lua -o $@ $< $(SRC_DIR)/%.swg.c_h: - pwd @$(GEN_MESSAGE) $(VERBOSE)$(SWIG) $(SWIG_INCDIR) -c++ -lua -small -external-runtime $@ +endif diff --git a/l4/pkg/io/server/src/Makefile b/l4/pkg/io/server/src/Makefile index fa6a95e3b..b42b079f3 100644 --- a/l4/pkg/io/server/src/Makefile +++ b/l4/pkg/io/server/src/Makefile @@ -13,7 +13,7 @@ CC_YY := $(SRC_YY:%.yy=%.tab.cc) $(SRC_YY:%.yy=%.tab.hh) # generate scanner in the source dir, to prevent a hard dependency to ragel CC_RL := $(SRC_DIR)/cfg_scan.cc -regen_files: $(CC_RL) $(CC_YY) +regen_files:: $(CC_RL) $(CC_YY) $(CC_RL): %.cc: %.rl $(SRC_DIR)/Makefile @$(GEN_MESSAGE) diff --git a/l4/pkg/l4sys/include/__vm-svm.h b/l4/pkg/l4sys/include/__vm-svm.h index 5cb81da25..de81b28e1 100644 --- a/l4/pkg/l4sys/include/__vm-svm.h +++ b/l4/pkg/l4sys/include/__vm-svm.h @@ -23,8 +23,7 @@ */ #pragma once -#include -#include +#include /** * \defgroup l4_vm_svm_api VM API for SVM diff --git a/l4/pkg/l4util/lib/src/Makefile b/l4/pkg/l4util/lib/src/Makefile index b39cf301b..fab684b13 100644 --- a/l4/pkg/l4util/lib/src/Makefile +++ b/l4/pkg/l4util/lib/src/Makefile @@ -20,7 +20,7 @@ PRIVATE_INCDIR_ARCH-x86/perform.s.o = ARCH-x86 include $(L4DIR)/mk/lib.mk -ARCH-x86/perform.o: ARCH-x86/pmc_events.h +ARCH-x86/perform.o ARCH-x86/perform.s.o: ARCH-x86/pmc_events.h ARCH-x86/pmc_events.h: pmc_events.in @$(GEN_MESSAGE) $(VERBOSE)sort < $^ > $(OBJ_DIR)/$(^F).sorted || rm $(OBJ_DIR)/$(^F).sorted diff --git a/l4/pkg/libio-io/lib/src/io.cc b/l4/pkg/libio-io/lib/src/io.cc index c6d42784b..2d7e93d7e 100644 --- a/l4/pkg/libio-io/lib/src/io.cc +++ b/l4/pkg/libio-io/lib/src/io.cc @@ -232,6 +232,9 @@ int l4io_iterate_devices(l4io_device_handle_t *devhandle, l4io_device_t *dev, l4io_resource_handle_t *reshandle) { + if (!vbus().is_valid()) + return -L4_ENOENT; + if (reshandle) *reshandle = 0; diff --git a/l4/pkg/libstdc++-headers/include-std/Makefile b/l4/pkg/libstdc++-headers/include-std/Makefile index 6024f9c2c..a849b2c17 100644 --- a/l4/pkg/libstdc++-headers/include-std/Makefile +++ b/l4/pkg/libstdc++-headers/include-std/Makefile @@ -8,7 +8,7 @@ PKGNAME = libstdc++-v3 INCSRC_DIR = $(STDCXX_CONTRIB_DIR)/include TARGET = $(shell (cd $(INCSRC_DIR) && find . -type f -not -name 'Make*' -print)) -LIBSUPC_H := exception new typeinfo +LIBSUPC_H := exception new typeinfo cxxabi.h LIBSUPC_H-4.6_PLUS- := exception_defines.h cxxabi-forced.h LIBSUPC_H-4.6_PLUS-y := bits/exception_defines.h bits/cxxabi_forced.h bits/hash_bytes.h LIBSUPC_H-4.7_PLUS-y += bits/atomic_lockfree_defines.h diff --git a/l4/pkg/libvcpu/include/vcpu b/l4/pkg/libvcpu/include/vcpu index 591e51c80..197e3088a 100644 --- a/l4/pkg/libvcpu/include/vcpu +++ b/l4/pkg/libvcpu/include/vcpu @@ -147,17 +147,19 @@ public: { l4vcpu_irq_restore(this, s, utcb, do_event_work_cb, setup_ipc); } /** - * \brief Halt/block the vCPU. + * \brief Wait for event. * * \param utcb The UTCB to use. * \param do_event_work_cb Call-back function that is called in case an * event (such as an interrupt) is pending. * \param setup_ipc Call-back function that is called before an * IPC operation is called. + * + * Note that event delivery remains disabled after this function returns. */ - void halt(l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, - l4vcpu_setup_ipc_t setup_ipc) throw() - { l4vcpu_halt(this, utcb, do_event_work_cb, setup_ipc); } + void wait_for_event(l4_utcb_t *utcb, l4vcpu_event_hndl_t do_event_work_cb, + l4vcpu_setup_ipc_t setup_ipc) throw() + { l4vcpu_wait_for_event(this, utcb, do_event_work_cb, setup_ipc); } /** * \brief Set the task of the vCPU. diff --git a/l4/pkg/libvcpu/include/vcpu.h b/l4/pkg/libvcpu/include/vcpu.h index 4d78d955b..2311e8608 100644 --- a/l4/pkg/libvcpu/include/vcpu.h +++ b/l4/pkg/libvcpu/include/vcpu.h @@ -141,7 +141,7 @@ l4vcpu_wait(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW; /** - * \brief Halt the vCPU (sleep). + * \brief Wait for event. * \ingroup api_libvcpu * * \param vcpu Pointer to vCPU area. @@ -150,12 +150,14 @@ l4vcpu_wait(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, * awakes and needs to handle an event/IRQ. * \param setup_ipc Function call-back that is called right before * any IPC operation. + * + * Note that event delivery remains disabled after this function returns. */ L4_CV L4_INLINE void -l4vcpu_halt(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, - l4vcpu_event_hndl_t do_event_work_cb, - l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW; +l4vcpu_wait_for_event(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, + l4vcpu_event_hndl_t do_event_work_cb, + l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW; /** @@ -290,12 +292,11 @@ l4vcpu_irq_restore(l4_vcpu_state_t *vcpu, l4vcpu_irq_state_t s, L4_CV L4_INLINE void -l4vcpu_halt(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, - l4vcpu_event_hndl_t do_event_work_cb, - l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW +l4vcpu_wait_for_event(l4_vcpu_state_t *vcpu, l4_utcb_t *utcb, + l4vcpu_event_hndl_t do_event_work_cb, + l4vcpu_setup_ipc_t setup_ipc) L4_NOTHROW { l4vcpu_wait(vcpu, utcb, L4_IPC_NEVER, do_event_work_cb, setup_ipc); - l4vcpu_irq_enable(vcpu, utcb, do_event_work_cb, setup_ipc); } __END_DECLS diff --git a/l4/pkg/libvcpu/lib/src/ARCH-amd64/arch.cc b/l4/pkg/libvcpu/lib/src/ARCH-amd64/arch.cc index 4cc945bf2..bf62efc99 100644 --- a/l4/pkg/libvcpu/lib/src/ARCH-amd64/arch.cc +++ b/l4/pkg/libvcpu/lib/src/ARCH-amd64/arch.cc @@ -22,11 +22,10 @@ void l4vcpu_print_state_arch(l4_vcpu_state_t *vcpu, const char *prefix) L4_NOTHROW { - printf("%svcpu=%p ip=%08lx sp=%08lx trapno=%08lx label=%lx\n", - prefix, vcpu, vcpu->r.ip, vcpu->r.sp, vcpu->r.trapno, vcpu->i.label); + printf("%sip=%08lx sp=%08lx trapno=%08lx\n", + prefix, vcpu->r.ip, vcpu->r.sp, vcpu->r.trapno); printf("%sax=%08lx dx=%08lx bx=%08lx cx=%08lx\n", prefix, vcpu->r.ax, vcpu->r.dx, vcpu->r.bx, vcpu->r.cx); printf("%ssi=%08lx di=%08lx bp=%08lx flags=%08lx\n", prefix, vcpu->r.si, vcpu->r.di, vcpu->r.bp, vcpu->r.flags); } - diff --git a/l4/pkg/libvcpu/lib/src/ARCH-x86/arch.cc b/l4/pkg/libvcpu/lib/src/ARCH-x86/arch.cc index cf808e9a6..db2b99a00 100644 --- a/l4/pkg/libvcpu/lib/src/ARCH-x86/arch.cc +++ b/l4/pkg/libvcpu/lib/src/ARCH-x86/arch.cc @@ -31,4 +31,3 @@ void l4vcpu_print_state_arch(l4_vcpu_state_t *vcpu, printf("%sds=%08lx es=%08lx gs=%08lx fs=%08lx\n", prefix, vcpu->r.ds, vcpu->r.es, vcpu->r.gs, vcpu->r.fs); } - diff --git a/l4/pkg/libvcpu/lib/src/vcpu.cc b/l4/pkg/libvcpu/lib/src/vcpu.cc index 51bbe1be1..abe6b44c8 100644 --- a/l4/pkg/libvcpu/lib/src/vcpu.cc +++ b/l4/pkg/libvcpu/lib/src/vcpu.cc @@ -27,8 +27,9 @@ l4vcpu_print_state(l4_vcpu_state_t *vcpu, { printf("%svcpu=%p state=%x savedstate=%x label=%lx\n", prefix, vcpu, vcpu->state, vcpu->saved_state, vcpu->i.label); - printf("%ssticky=%x user_task=%lx\n", - prefix, vcpu->sticky_flags, vcpu->user_task << L4_CAP_SHIFT); + printf("%ssticky=%x user_task=%lx pfa=%lx\n", + prefix, vcpu->sticky_flags, vcpu->user_task << L4_CAP_SHIFT, + vcpu->r.pfa); printf("%sentry_sp=%lx entry_ip=%lx\n", prefix, vcpu->entry_sp, vcpu->entry_ip); l4vcpu_print_state_arch(vcpu, prefix); diff --git a/l4/pkg/mag-gfx/include/gfx_colors b/l4/pkg/mag-gfx/include/gfx_colors index 0d131b6cb..960bfbe24 100644 --- a/l4/pkg/mag-gfx/include/gfx_colors +++ b/l4/pkg/mag-gfx/include/gfx_colors @@ -617,6 +617,7 @@ typedef Color_traits, 11,5,5,6,0,5> > Rgb16; typedef Color_traits, 0,5,5,6,11,5> > Bgr16; typedef Color_traits, 16,8,8,8,0,8> > Rgb24; typedef Color_traits, 16,8,8,8,0,8> > Rgb32; +typedef Color_traits, 0,8,8,8,16,8> > Bgr32; typedef Color_traits, 16,8,8,8,0,8,24,8> > Rgba32; } diff --git a/l4/pkg/mag/server/src/screen.cc b/l4/pkg/mag/server/src/screen.cc index ee569d631..3c531f88b 100644 --- a/l4/pkg/mag/server/src/screen.cc +++ b/l4/pkg/mag/server/src/screen.cc @@ -44,6 +44,7 @@ static Csf _csf_rgb16; static Csf _csf_bgr16; static Csf _csf_rgb24; static Csf _csf_rgb32; +static Csf _csf_bgr32; static Csf _csf_rgba32; } diff --git a/l4/pkg/moe/server/src/alloc.cc b/l4/pkg/moe/server/src/alloc.cc index 7a3a279dc..7d206fe26 100644 --- a/l4/pkg/moe/server/src/alloc.cc +++ b/l4/pkg/moe/server/src/alloc.cc @@ -264,14 +264,14 @@ Allocator::disp_factory(l4_umword_t r, L4::Ipc::Iostream &ios) if (!size.is_of_int()) return -L4_EINVAL; - //L4::cout << "MEM: alloc ... " << size << "; " << flags << "\n"; + // L4::cout << "MEM: alloc ... " << size.value() << "; " << flags.value() << "\n"; cxx::Auto_ptr mo(alloc(size.value(), flags.is_of_int() ? flags.value() : 0)); // L4::cout << "MO=" << mo.get() << "\n"; ko = object_pool.cap_alloc()->alloc(mo.get()); ko->dec_refcnt(1); - //L4::cout << "MO_CAP=" << mo->obj_cap() << "\n"; + // L4::cout << "MO_CAP=" << mo->obj_cap() << "\n"; ios << ko; mo.release(); return L4_EOK; diff --git a/l4/pkg/moe/server/src/quota.h b/l4/pkg/moe/server/src/quota.h index cde2c3f82..08d0324e9 100644 --- a/l4/pkg/moe/server/src/quota.h +++ b/l4/pkg/moe/server/src/quota.h @@ -40,11 +40,18 @@ public: explicit Quota(size_t limit) : _limit(limit), _used(0) {} bool alloc(size_t s) { - if (_limit && (s > _limit || _used > _limit - s)) + if (_limit && (s > _limit)) return false; + if (_limit && (_used > _limit - s)) + { + GC_gcollect_and_unmap(); + if (_used > _limit - s) + return false; + } + _used += s; - // printf("Q: alloc(%zx) -> %zx\n", s, _used); + //printf("Q: alloc(%zx) -> %zx\n", s, _used); return true; } diff --git a/l4/pkg/plr/Control b/l4/pkg/plr/Control index 7f668332e..838800cdd 100644 --- a/l4/pkg/plr/Control +++ b/l4/pkg/plr/Control @@ -1,4 +1,4 @@ requires: libudis86 stdlibs libiniparser cxx_io libio-vbus libstdc++ - libvcpu libloader liblwip_netif_ankh -provides: romain + libvcpu libloader liblwip_netif_ankh zlib +provides: romain libpthread_rep libuu libevbuf_c maintainer: doebel@os.inf.tu-dresden.de diff --git a/l4/pkg/plr/Makefile b/l4/pkg/plr/Makefile index 4c40488c0..0c402eb60 100644 --- a/l4/pkg/plr/Makefile +++ b/l4/pkg/plr/Makefile @@ -10,6 +10,6 @@ SYSTEMS = x86-l4f TARGET = include server lib ex -ex : server lib +ex : lib server include $(L4DIR)/mk/subdir.mk diff --git a/l4/pkg/plr/doc/romain.lua b/l4/pkg/plr/doc/romain.lua index 65e69f99c..a115f2adb 100644 --- a/l4/pkg/plr/doc/romain.lua +++ b/l4/pkg/plr/doc/romain.lua @@ -13,7 +13,7 @@ ldr:start( { caps = { }, log = {"romain", "c"}, }, --- "rom/romain rom/hello" + "rom/romain rom/hello" -- "rom/romain rom/pthread_hello" - "rom/romain rom/pthread_mutex" +-- "rom/romain rom/pthread_mutex" ); diff --git a/l4/pkg/plr/doc/threadini.sh b/l4/pkg/plr/doc/threadini.sh index 54cf554a4..47a17ba69 100755 --- a/l4/pkg/plr/doc/threadini.sh +++ b/l4/pkg/plr/doc/threadini.sh @@ -1,18 +1,35 @@ #!/bin/bash +echo "# generated for '$1'" echo "[general]" -#echo " print_vcpu_state = y" echo " page_fault_handling = rw" -echo " log = all" echo " threads = yes" -echo " redundancy = none" -#echo " debug = simple" +echo "# redundancy = none" +echo "# redundancy = dual" +echo "# redundancy = triple" +echo " logbuf = 12" +echo " logrdtsc = true" +echo " logreplica = true" +echo "" +echo "# print_vcpu_state = y" +echo "# log = all" + echo "" echo "[threads]" -function_list="__pthread_lock __pthread_unlock pthread_mutex_init pthread_mutex_lock pthread_mutex_unlock" +function_list="__pthread_lock __pthread_unlock pthread_mutex_lock pthread_mutex_unlock" for f in $function_list; do nm $1 | grep -E "\ $f" | sed -re "s/([0-9a-f]+) [TW] ($f(_rep)?)/ \2 = 0x\1/" | sed -re "s/[_]*pthread_//g" done + + +kiptime="" +for line in `objdump -lSCd $1 | grep ff0a0 | cut -d: -f 1`; do + kiptime+="0x$line " +done +kiptime=`echo $kiptime | sed -re 's/\w$//' | sed -re 's/ 0x/,0x/g'` +echo "" +echo "[kip-time]" +echo "target = $kiptime" diff --git a/l4/pkg/plr/ex/Makefile b/l4/pkg/plr/ex/Makefile index 907abdde8..58db32b0f 100644 --- a/l4/pkg/plr/ex/Makefile +++ b/l4/pkg/plr/ex/Makefile @@ -1,6 +1,10 @@ PKGDIR ?= .. L4DIR ?= $(PKGDIR)/../.. -TARGET = serial_client trap+emulate dataspaces pthread_hello pthread_mutex +TARGET = serial_client \ + trap+emulate \ + pthread_hello \ + pthread_mutex \ + eventbuf include $(L4DIR)/mk/subdir.mk diff --git a/l4/pkg/plr/ex/eventbuf/Makefile b/l4/pkg/plr/ex/eventbuf/Makefile new file mode 100644 index 000000000..d8c0a950e --- /dev/null +++ b/l4/pkg/plr/ex/eventbuf/Makefile @@ -0,0 +1,20 @@ +PKGDIR ?= ../.. +L4DIR ?= $(PKGDIR)/../.. + +TARGET = romain_eventbuf + +SYSTEMS = x86-l4f + +# list your .c or .cc files here +SRC_C = +SRC_CC = main.cc + +CXXFLAGS += -I$(SRC_DIR)/../../server/src/ +CXXFLAGS += $(call checkcxx,-std=c++11) + +vpath %.cc $(SRC_DIR)/../../server/src/ + +# list requirements of your program here +REQUIRES_LIBS = libstdc++ libvcpu libudis86 zlib libuu + +include $(L4DIR)/mk/prog.mk diff --git a/l4/pkg/plr/ex/eventbuf/main.cc b/l4/pkg/plr/ex/eventbuf/main.cc new file mode 100644 index 000000000..a5baebe15 --- /dev/null +++ b/l4/pkg/plr/ex/eventbuf/main.cc @@ -0,0 +1,61 @@ +#include +#include +#include + +#include +#include + +#include +#include + +Measurements::EventBuf eb; + +unsigned char buffer[1024 * 1024]; + +int main() +{ + printf("EB\n"); + eb.set_buffer(buffer, sizeof(buffer)); + printf("EB.buf = %p, size %d, index %d\n", + eb.buffer, eb.size, eb.index); + + printf("Generating 200 events...\n"); + for (unsigned i = 0; i < 100; ++i) { + + Measurements::GenericEvent* ev = eb.next(); + ev->header.tsc = l4_rdtsc(); + ev->header.vcpu = 0x1234; + ev->header.type = Measurements::Foo; + ev->data.foo.start = 1; + printf("%d %llx\n", ev->header.type, ev->header.tsc); + + l4_sleep(random() % 100); + + ev = eb.next(); + ev->header.tsc = l4_rdtsc(); + ev->header.vcpu = 0x1234; + ev->header.type = Measurements::Foo; + ev->data.foo.start = 0; + } + + printf("EB.buf = %p, size %d, index %d\n", + eb.buffer, eb.size, eb.index); + printf("EB.oldest = %d\n", eb.oldest()); + + char const *filename = "sampledump.txt"; + + unsigned oldest = eb.oldest(); + unsigned dump_start, dump_size; + + if (oldest == 0) { // half-full -> dump from 0 to index + dump_start = 0; + dump_size = eb.index * sizeof(Measurements::GenericEvent); + } else { // buffer completely full -> dump full size starting from oldest entry + dump_start = oldest * sizeof(Measurements::GenericEvent); + dump_size = eb.size * sizeof(Measurements::GenericEvent); + } + + uu_dumpz_ringbuffer(filename, eb.buffer, eb.size * sizeof(Measurements::GenericEvent), + dump_start, dump_size); + return 0; +} diff --git a/l4/pkg/plr/ex/hello/Makefile b/l4/pkg/plr/ex/hello/Makefile new file mode 100644 index 000000000..1ed347857 --- /dev/null +++ b/l4/pkg/plr/ex/hello/Makefile @@ -0,0 +1,15 @@ +PKGDIR ?= ../../.. +L4DIR ?= $(PKGDIR)/.. + +TARGET = romain_hello romain_hello_c +SRC_CC_romain_hello = main.cc +SRC_C_romain_hello_c = cmain.c + +PRIVATE_INCDIR = $(SRC_DIR)/../../server/src/ + +CXXFLAGS += $(call checkcxx,-std=c++11) +REQUIRES_LIBS = libstdc++ libevbuf_c + +SYSTEMS = x86-l4f + +include $(L4DIR)/mk/prog.mk diff --git a/l4/pkg/plr/ex/hello/cmain.c b/l4/pkg/plr/ex/hello/cmain.c new file mode 100644 index 000000000..e85b3fb17 --- /dev/null +++ b/l4/pkg/plr/ex/hello/cmain.c @@ -0,0 +1,27 @@ +#include + +#include +#include + +#include + +int main() +{ + printf("starting Hello (C version)\n"); + + void *ebuf = (void*)0xB0000000; + + unsigned i = 0; + for ( ; i < 5; ++i) { + + struct GenericEvent *ev = evbuf_next(ebuf); + ev->header.tsc = evbuf_get_time(ebuf, 1); + ev->header.vcpu = 0x1234; + ev->header.type = 4; + + printf("HELLO..\n"); + + l4_sleep(1000); + } + return 0; +} diff --git a/l4/pkg/plr/ex/hello/main.cc b/l4/pkg/plr/ex/hello/main.cc new file mode 100644 index 000000000..afa990fe7 --- /dev/null +++ b/l4/pkg/plr/ex/hello/main.cc @@ -0,0 +1,37 @@ +#include + +#include +#include + +#include "constants.h" +#include + +int main() +{ + std::cout << "starting Hello (C++ version)" << std::endl; + + Measurements::EventBuf *eb = reinterpret_cast(Romain::REPLICA_LOG_ADDRESS); + std::cout << "evbuf @ " << std::hex << eb << " " << eb->index << " " << eb->size << std::endl; + + for (unsigned i = 0; i < 5; ++i) { + std::cout << "creating event ... " << &eb->index << std::endl; + Measurements::GenericEvent* ev = eb->next(); + std::cout << " next @ " << std::hex << ev << std::endl; + ev->header.tsc = l4_rdtsc(); + ev->header.vcpu = 0x1234; + ev->header.type = Measurements::Foo; + ev->data.foo.start = true; + + std::cout << "HELLO" << std::endl; + + ev = eb->next(); + ev->header.tsc = l4_rdtsc(); + ev->header.vcpu = 0x1234; + ev->header.type = Measurements::Foo; + ev->data.foo.start = false; + + l4_sleep(1000); + } + + return 0; +} diff --git a/l4/pkg/plr/ex/pthread_hello/main.c b/l4/pkg/plr/ex/pthread_hello/main.c index 5ffcb89c4..32bf58983 100644 --- a/l4/pkg/plr/ex/pthread_hello/main.c +++ b/l4/pkg/plr/ex/pthread_hello/main.c @@ -24,6 +24,7 @@ int main(int argc, char **argv) (void)argc; (void)argv; pthread_t pt; + printf("\033[32mhello from main thread\033[0m\n"); int res = pthread_create(&pt, NULL, thread, NULL); assert(res == 0); diff --git a/l4/pkg/plr/ex/pthread_mutex/Makefile b/l4/pkg/plr/ex/pthread_mutex/Makefile index c469cd8e0..6508bba12 100644 --- a/l4/pkg/plr/ex/pthread_mutex/Makefile +++ b/l4/pkg/plr/ex/pthread_mutex/Makefile @@ -5,6 +5,7 @@ SYSTEMS = x86-l4f TARGET = pthread_mutex SRC_C = main.c +#REQUIRES_LIBS += libpthread include $(L4DIR)/mk/prog.mk diff --git a/l4/pkg/plr/ex/pthread_mutex/main.c b/l4/pkg/plr/ex/pthread_mutex/main.c index be33cfd0a..bac8c3b12 100644 --- a/l4/pkg/plr/ex/pthread_mutex/main.c +++ b/l4/pkg/plr/ex/pthread_mutex/main.c @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -11,43 +12,80 @@ static int globalcounter; pthread_mutex_t mtx; +static const unsigned print_iterations = 100; +static const unsigned inc_iterations = 10000; + static void *thread(void *data) { (void)data; +#if 0 while (1) { - for (unsigned i = 0; i < 10000; ++i) { +#else + for (unsigned cnt = 0; cnt < print_iterations; ++cnt) { +#endif + for (unsigned i = 0; i < inc_iterations; ++i) { pthread_mutex_lock(&mtx); globalcounter++; pthread_mutex_unlock(&mtx); } + + pthread_mutex_lock(&mtx); printf("\033[31mThread: %d\n", globalcounter); + pthread_mutex_unlock(&mtx); } return NULL; } + +static int diff_ms(struct timeval *t1, struct timeval *t2) +{ + return (((t1->tv_sec - t2->tv_sec) * 1000000) + + (t1->tv_usec - t2->tv_usec))/1000; +} + + int main(int argc, char **argv) { (void)argc; (void)argv; pthread_t pt; + + struct timeval start, stop; + + gettimeofday(&start, NULL); + pthread_mutex_init(&mtx, 0); int res = pthread_create(&pt, NULL, thread, NULL); assert(res == 0); +#if 0 while (1) { - for (unsigned i = 0; i < 10000; ++i) { +#else + for (unsigned cnt = 0; cnt < print_iterations; ++cnt) { +#endif + for (unsigned i = 0; i < inc_iterations; ++i) { pthread_mutex_lock(&mtx); globalcounter++; pthread_mutex_unlock(&mtx); } + + pthread_mutex_lock(&mtx); printf("\033[32mMain: %d\n", globalcounter); + pthread_mutex_unlock(&mtx); } pthread_join(pt, NULL); - enter_kdebug("before return"); + gettimeofday(&stop, NULL); + + unsigned long ms = diff_ms(&stop, &start); + printf("Start %ld.%ld --- Stop %ld.%ld --- Diff %ld.%03ld\n", + start.tv_sec, start.tv_usec, stop.tv_sec, stop.tv_usec, + ms / 1000, ms % 1000); + + //enter_kdebug("before return"); return 0; } diff --git a/l4/pkg/plr/include/measurements.h b/l4/pkg/plr/include/measurements.h new file mode 100644 index 000000000..66e4a5b86 --- /dev/null +++ b/l4/pkg/plr/include/measurements.h @@ -0,0 +1,225 @@ +#pragma once + +/* + * measurements.h -- + * + * Event logging infrastructure + * + * (c) 2012-2013 Björn Döbel , + * economic rights: Technische Universität Dresden (Germany) + * This file is part of TUD:OS and distributed under the terms of the + * GNU General Public License 2. + * Please see the COPYING-GPL-2 file for details. + */ + +#include +#include +//#include + +#include +#include +#include + +/* + * Namespace containing classes regarding measurements and + * sensors etc. + * + * XXX: C compatibility! Don't use C++ features except inside __cplusplus parts -> I want to + * use this header file from C files, too + */ +#ifdef __cplusplus +namespace Measurements +{ +#endif + + enum EventTypes { + Invalid = 0, + Syscall = 1, + Pagefault = 2, + Swifi = 3, + Foo = 4, + Trap = 5, + Thread_start = 6, + Thread_stop = 7, + }; + + struct __attribute__((packed)) + SensorHead { + l4_uint64_t tsc; // TSC: stop + l4_uint32_t vcpu; // vcpu ptr + unsigned char type; // event type + }; + + + struct __attribute__((packed)) + PagefaultEvent + { + char rw; + l4_addr_t address; + l4_addr_t localbase; + l4_addr_t remotebase; + }; + + struct __attribute__((packed)) + TrapEvent + { + char start; + l4_addr_t trapaddr; + l4_uint32_t trapno; + }; + + + struct __attribute__((packed)) + SyscallEvent + { + l4_addr_t eip; + l4_uint32_t label; + }; + + + struct __attribute__((packed)) + FooEvent + { + unsigned start; + }; + + + struct __attribute__((packed)) + GenericEvent + { + struct SensorHead header; + union { + struct PagefaultEvent pf; + struct SyscallEvent sys; + struct FooEvent foo; + struct TrapEvent trap; + char pad[19]; + } data; + }; + + + /* + * Event buffer + * + * An event buffer holds events of the GenericEvent type. The class does not + * allocate memory. Instead the underlying buffer needs to be specified using + * the set_buffer() function. + * + * Once the buffer is valid, users obtain an element using the next() method + * and fill it appropriately. + * + * The buffer is managed as a ring buffer and may overflow, in which case the + * oldest elements get overwritten. The index variable is increased monotonically, + * so users may determine whether the buffer has already overflown by checking + * if index > size. If so, (index mod size) points to the oldest element. + * + * The whole buffer can be dumped using the dump() method. This will produce a UU-encoded + * version of the zipped buffer content. + */ + struct __attribute__((packed)) + EventBuf + { + struct GenericEvent* buffer; + unsigned index; + unsigned size; + unsigned sharedTSC; + l4_uint64_t *timestamp; + char _end[]; + +#ifdef __cplusplus + + /** + * Create event buffer + * + * sharableTSC -> allow the TSC value to be located in a way that we can share + * this value among different address spaces (e.g., have replicas + * log events themselves using this TSC). This requires the timestamp + * value to be placed on a dedicated page. + */ + EventBuf(bool sharableTSC = false) + : buffer(0), index(0), size(0), sharedTSC(sharableTSC ? 1 : 0) + { + static_assert(sizeof(SensorHead) == 13, "Sensor head not 13 bytes large!"); + static_assert(sizeof(GenericEvent) == 32, "GenericEvent larger than 24 bytes!"); + //static_assert((l4_umword_t)((EventBuf const *)0)->_end < sizeof(GenericEvent), "head too large?"); + + if (!sharableTSC) { + timestamp = new l4_uint64_t(); + } + + static unsigned char dummyBuffer[32]; + set_buffer(dummyBuffer, 32); + } + + + ~EventBuf() + { + enter_kdebug("~EventBuf"); + if (!sharedTSC) { + delete timestamp; + } + } + + + void set_buffer(unsigned char *buf, unsigned size_in_bytes) + { + buffer = reinterpret_cast(buf); + size = size_in_bytes / sizeof(GenericEvent); + } + + + void set_tsc_buffer(l4_uint64_t *buf) + { + timestamp = buf; + } + + + static void launchTimerThread(l4_addr_t timerAddress, unsigned CPU); + + l4_uint64_t getTime(bool local=false) + { + if (local) { + return l4_rdtsc(); + } else { + return *timestamp; + } + } + + /* + * Get the next buffer entry. + * + * Safe against concurrent calls by using atomic increment on the + * counter. Concurrent accesses may lead to events not being properly + * ordered, though. + */ + GenericEvent* next() + { + unsigned val = l4util_inc32_res(&index) - 1; + val %= size; + return &buffer[val]; + } + + + unsigned oldest() const + { + if (index < size) { + return 0; + } + else { + return index % size; + } + } +#endif /* C++ */ + }; + +#ifdef __cplusplus +} + +extern "C" +{ +#endif + l4_uint64_t evbuf_get_time(void *eb, unsigned local); + struct GenericEvent* evbuf_next(void *eb); +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/l4/pkg/plr/include/pthread_rep.h b/l4/pkg/plr/include/pthread_rep.h index 4fd590cf8..8da18ddba 100644 --- a/l4/pkg/plr/include/pthread_rep.h +++ b/l4/pkg/plr/include/pthread_rep.h @@ -11,6 +11,7 @@ enum { pt_max_wrappers = 5, lock_entry_free = 0, + lock_unlocking = 0xAAAAAAAA, lock_unowned = 0xFFFFFFFF, NUM_TRAMPOLINES = 32, @@ -22,12 +23,13 @@ enum { typedef struct { unsigned char trampolines[NUM_TRAMPOLINES * TRAMPOLINE_SIZE]; struct { - l4_addr_t lockdesc; // corresponding pthread_mutex_t ptr - l4_addr_t owner; // lock owner - volatile l4_addr_t wait_count; // count how many threads wait to acquire this lock - l4_addr_t acq_count; // count how many threads acquired this lock - l4_addr_t wake_count; // count how many threads should be unlocked - volatile l4_uint32_t lock; // internal: lock for this row + volatile l4_addr_t lockdesc; // corresponding pthread_mutex_t ptr + volatile l4_addr_t owner; // lock owner + volatile l4_addr_t owner_epoch; // lock holder's epoch + volatile l4_addr_t wait_count; // count how many threads wait to acquire this lock + volatile l4_addr_t acq_count; // count how many threads acquired this lock + volatile l4_addr_t wake_count; // count how many threads should be unlocked + volatile l4_uint32_t lock; // internal: lock for this row } locks[NUM_LOCKS]; volatile l4_umword_t replica_count; // number of replicas running a.t.m. } lock_info; @@ -41,16 +43,19 @@ lock_info* get_lock_info(void) { } -static inline void lock_li(lock_info *li, unsigned idx) +static inline void lock_li(volatile lock_info *li, unsigned idx) { - while (l4util_cmpxchg32(&li->locks[idx].lock, 0, 1) == 0) { - asm volatile ("ud2" : : : "memory"); + asm volatile ("" : : : "memory"); + while (!l4util_cmpxchg32(&li->locks[idx].lock, 0, 1)) { + asm volatile ("ud2" : : : "eax", "memory"); } } -static inline void unlock_li(lock_info* li, unsigned idx) +static inline void unlock_li(volatile lock_info* li, unsigned idx) { + asm volatile ("" : : : "eax", "memory"); li->locks[idx].lock = 0; + asm volatile ("" ::: "memory"); } diff --git a/l4/pkg/plr/include/uu.h b/l4/pkg/plr/include/uu.h new file mode 100644 index 000000000..6bf16ce5c --- /dev/null +++ b/l4/pkg/plr/include/uu.h @@ -0,0 +1,29 @@ +/** + * \file ferret/examples/merge_mon/uu.h + * \brief UUencoding functions, mostly from jdb + * + * \date 14/12/2005 + * \author Martin Pohlack + */ +/* + * (c) 2005-2009 Technische Universität Dresden + * This file is part of TUD:OS and distributed under the terms of the + * GNU General Public License 2. + * Please see the COPYING-GPL-2 file for details. + */ +#ifndef __FERRET_EXAMPLES_MERGE_MON_UU_H_ +#define __FERRET_EXAMPLES_MERGE_MON_UU_H_ + +EXTERN_C_BEGIN + +#include + +//void uu_dump(const char * filename, const buf_t *buf); +void uu_dumpz(const char * filename, const unsigned char * s_buf, size_t len); +void uu_dumpz_ringbuffer(const char * filename, + const void * buffer, size_t buffer_len, + unsigned start_offset, size_t transfer_size); + +EXTERN_C_END + +#endif diff --git a/l4/pkg/plr/lib/Makefile b/l4/pkg/plr/lib/Makefile index 6b9562ef4..896578197 100644 --- a/l4/pkg/plr/lib/Makefile +++ b/l4/pkg/plr/lib/Makefile @@ -1,6 +1,6 @@ PKGDIR ?= .. L4DIR ?= $(PKGDIR)/../.. -TARGET = libpthread_romain +TARGET = libpthread_romain libuu libevbuf_c include $(L4DIR)/mk/subdir.mk diff --git a/l4/pkg/plr/lib/libevbuf_c/Makefile b/l4/pkg/plr/lib/libevbuf_c/Makefile new file mode 100644 index 000000000..41258ef42 --- /dev/null +++ b/l4/pkg/plr/lib/libevbuf_c/Makefile @@ -0,0 +1,15 @@ +PKGDIR?= ../.. +L4DIR ?= $(PKGDIR)/../.. + +SYSTEMS = x86-l4f + +# the name of your library +TARGET = libevbuf_c.a + +PC_FILENAME = libevbuf_c + +# list your .c or .cc files here +SRC_C = +SRC_CC = eb.cc + +include $(L4DIR)/mk/lib.mk diff --git a/l4/pkg/plr/lib/libevbuf_c/eb.cc b/l4/pkg/plr/lib/libevbuf_c/eb.cc new file mode 100644 index 000000000..6b6993dc6 --- /dev/null +++ b/l4/pkg/plr/lib/libevbuf_c/eb.cc @@ -0,0 +1,12 @@ +#include + +extern "C" l4_uint64_t evbuf_get_time(void *eb, unsigned local) +{ + return reinterpret_cast(eb)->getTime(local == 1); +} + + +extern "C" struct GenericEvent* evbuf_next(void *eb) +{ + return (GenericEvent*)reinterpret_cast(eb)->next(); +} diff --git a/l4/pkg/plr/lib/libpthread_romain/src/Makefile b/l4/pkg/plr/lib/libpthread_romain/src/Makefile index cbee2f35d..22e585f49 100644 --- a/l4/pkg/plr/lib/libpthread_romain/src/Makefile +++ b/l4/pkg/plr/lib/libpthread_romain/src/Makefile @@ -40,7 +40,7 @@ INCDIR-x86 = $(ORIGDIR)/sysdeps/i386/i686 $(ORIGDIR)/sysdeps/i386 \ #INCDIR-ppc32 = $(ORIGDIR)/sysdeps/powerpc #INCDIR-sparc = $(ORIGDIR)/sysdeps/sparc -PRIVATE_INCDIR = -I- $(ORIGDIR) $(SRC_DIR) $(INCDIR-$(ARCH)) $(CONTRIBDIR)/ldso/include +PRIVATE_INCDIR = -I- $(SRC_DIR) $(ORIGDIR) $(INCDIR-$(ARCH)) $(CONTRIBDIR)/ldso/include DEFINES := -DL4_THREAD_SAFE -D__USE_XOPEN2K -D_POSIX_C_SOURCE=200112L \ -D_GNU_SOURCE=1 -D__NO_WEAK_PTHREAD_ALIASES=1 \ @@ -52,8 +52,8 @@ DEFINES_x86-l4f := -DUSE___THREAD=1 #DEFINES_ppc32-l4f := -DUSE___THREAD=1 #DEFINES_sparc-l4f := -DUSE___THREAD=1 -CFLAGS += -include $(CONTRIBDIR)/include/libc-symbols.h -CXXFLAGS += -include $(CONTRIBDIR)/include/libc-symbols.h +CFLAGS += -include $(CONTRIBDIR)/include/libc-symbols.h -include $(SRC_DIR)/descr.h +CXXFLAGS += -include $(CONTRIBDIR)/include/libc-symbols.h -include $(SRC_DIR)/descr.h CXXFLAGS += -fno-exceptions include $(L4DIR)/mk/lib.mk diff --git a/l4/pkg/plr/lib/libpthread_romain/src/descr.h b/l4/pkg/plr/lib/libpthread_romain/src/descr.h new file mode 100644 index 000000000..d9343968b --- /dev/null +++ b/l4/pkg/plr/lib/libpthread_romain/src/descr.h @@ -0,0 +1,238 @@ +/* Linuxthreads - a simple clone()-based implementation of Posix */ +/* threads for Linux. */ +/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU Library General Public License */ +/* as published by the Free Software Foundation; either version 2 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Library General Public License for more details. */ + +#ifndef _DESCR_H +#define _DESCR_H 1 + +#define __need_res_state +#include +#include +#include +#include +#include +#include + +/* Fast thread-specific data internal to libc. */ +enum __libc_tsd_key_t { _LIBC_TSD_KEY_MALLOC = 0, + _LIBC_TSD_KEY_DL_ERROR, + _LIBC_TSD_KEY_RPC_VARS, + _LIBC_TSD_KEY_LOCALE, + _LIBC_TSD_KEY_CTYPE_B, + _LIBC_TSD_KEY_CTYPE_TOLOWER, + _LIBC_TSD_KEY_CTYPE_TOUPPER, + _LIBC_TSD_KEY_N }; + +/* The type of thread descriptors */ +typedef struct _pthread_descr_struct *pthread_descr; + + +/* Some more includes. */ +#include +//#include + + +/* Arguments passed to thread creation routine */ +struct pthread_start_args { + void *(*start_routine)(void *); /* function to run */ + void *arg; /* its argument */ +}; + + +/* Callback interface for removing the thread from waiting on an + object if it is cancelled while waiting or about to wait. + This hold a pointer to the object, and a pointer to a function + which ``extricates'' the thread from its enqueued state. + The function takes two arguments: pointer to the wait object, + and a pointer to the thread. It returns 1 if an extrication + actually occured, and hence the thread must also be signalled. + It returns 0 if the thread had already been extricated. */ +typedef struct _pthread_extricate_struct { + void *pu_object; + int (*pu_extricate_func)(void *, pthread_descr); +} pthread_extricate_if; + + +/* Atomic counter made possible by compare_and_swap */ +struct pthread_atomic { + long p_count; + int p_spinlock; +}; + + +/* Context info for read write locks. The pthread_rwlock_info structure + is information about a lock that has been read-locked by the thread + in whose list this structure appears. The pthread_rwlock_context + is embedded in the thread context and contains a pointer to the + head of the list of lock info structures, as well as a count of + read locks that are untracked, because no info structure could be + allocated for them. */ +struct _pthread_rwlock_t; +typedef struct _pthread_rwlock_info { + struct _pthread_rwlock_info *pr_next; + struct _pthread_rwlock_t *pr_lock; + int pr_lock_count; +} pthread_readlock_info; + + +/* We keep thread specific data in a special data structure, a two-level + array. The top-level array contains pointers to dynamically allocated + arrays of a certain number of data pointers. So we can implement a + sparse array. Each dynamic second-level array has + PTHREAD_KEY_2NDLEVEL_SIZE + entries. This value shouldn't be too large. */ +#define PTHREAD_KEY_2NDLEVEL_SIZE 32 + +/* We need to address PTHREAD_KEYS_MAX key with PTHREAD_KEY_2NDLEVEL_SIZE + keys in each subarray. */ +#define PTHREAD_KEY_1STLEVEL_SIZE \ + ((PTHREAD_KEYS_MAX + PTHREAD_KEY_2NDLEVEL_SIZE - 1) \ + / PTHREAD_KEY_2NDLEVEL_SIZE) + + +union dtv; + +struct _pthread_descr_struct +{ +#if !defined USE_TLS || !TLS_DTV_AT_TP || INCLUDE_TLS_PADDING + /* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */ + union + { + struct + { + void *tcb; /* Pointer to the TCB. This is not always + the address of this thread descriptor. */ + union dtv *dtvp; + pthread_descr self; /* Pointer to this structure */ + int multiple_threads; + uintptr_t sysinfo; + } data; + void *__padding[16]; + } p_header; +# define p_multiple_threads p_header.data.multiple_threads +#elif defined TLS_MULTIPLE_THREADS_IN_TCB && TLS_MULTIPLE_THREADS_IN_TCB + int p_multiple_threads; +#endif + + pthread_descr p_nextlive, p_prevlive; + /* Double chaining of active threads */ + pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */ + pthread_descr p_nextlock; /* can be on a queue and waiting on a lock */ + pthread_t p_tid; /* Thread identifier */ + + int p_priority; /* Thread priority (== 0 if not realtime) */ + int p_sched_policy; + + + l4_cap_idx_t p_thsem_cap; + l4_cap_idx_t p_th_cap; + struct _pthread_fastlock * p_lock; /* Spinlock for synchronized accesses */ + sigjmp_buf * p_cancel_jmp; /* where to siglongjmp on a cancel or NULL */ + char p_terminated; /* true if terminated e.g. by pthread_exit */ + char p_detached; /* true if detached */ + char p_exited; /* true if the assoc. process terminated */ + void * p_retval; /* placeholder for return value */ + int p_retcode; /* placeholder for return code */ + pthread_descr p_joining; /* thread joining on that thread or NULL */ + struct _pthread_cleanup_buffer * p_cleanup; /* cleanup functions */ + char p_cancelstate; /* cancellation state */ + char p_canceltype; /* cancellation type (deferred/async) */ + char p_canceled; /* cancellation request pending */ + struct pthread_start_args p_start_args; /* arguments for thread creation */ + void ** p_specific[PTHREAD_KEY_1STLEVEL_SIZE]; /* thread-specific data */ +#if !(USE_TLS && HAVE___THREAD) + void * p_libc_specific[_LIBC_TSD_KEY_N]; /* thread-specific data for libc */ + int * p_errnop; /* pointer to used errno variable */ + int p_errno; /* error returned by last system call */ + int * p_h_errnop; /* pointer to used h_errno variable */ + int p_h_errno; /* error returned by last netdb function */ + struct __res_state *p_resp; /* Pointer to resolver state */ +#endif + struct __res_state p_res; /* per-thread resolver state */ + int p_userstack; /* nonzero if the user provided the stack */ + void *p_guardaddr; /* address of guard area or NULL */ + size_t p_guardsize; /* size of guard area */ + struct pthread_atomic p_resume_count; /* number of times restart() was + called on thread */ + char p_woken_by_cancel; /* cancellation performed wakeup */ + char p_condvar_avail; /* flag if conditional variable became avail */ + char p_sem_avail; /* flag if semaphore became available */ + pthread_extricate_if *p_extricate; /* See above */ + pthread_readlock_info *p_readlock_list; /* List of readlock info structs */ + pthread_readlock_info *p_readlock_free; /* Free list of structs */ + int p_untracked_readlock_count; /* Readlocks not tracked by list */ + int p_inheritsched; /* copied from the thread attribute */ +#ifdef USE_TLS + char *p_stackaddr; /* Stack address. */ +#endif + size_t p_alloca_cutoff; /* Maximum size which should be allocated + using alloca() instead of malloc(). */ + unsigned p_epoch; + unsigned ebx, ecx, edx, esi, edi; + /* New elements must be added at the end. */ +} __attribute__ ((aligned(32))); /* We need to align the structure so that + doubles are aligned properly. This is 8 + bytes on MIPS and 16 bytes on MIPS64. + 32 bytes might give better cache + utilization. */ + + + +/* Limit between the stack of the initial thread (above) and the + stacks of other threads (below). Aligned on a STACK_SIZE boundary. + Initially 0, meaning that the current thread is (by definition) + the initial thread. */ + +extern char *__pthread_initial_thread_bos; + +/* Descriptor of the initial thread */ + +extern struct _pthread_descr_struct __pthread_initial_thread; + +/* Limits of the thread manager stack. */ + +extern char *__pthread_manager_thread_bos; +extern char *__pthread_manager_thread_tos; + +/* Descriptor of the manager thread */ + +extern struct _pthread_descr_struct __pthread_manager_thread; +extern pthread_descr __pthread_manager_threadp L4_HIDDEN; + +/* Indicate whether at least one thread has a user-defined stack (if 1), + or all threads have stacks supplied by LinuxThreads (if 0). */ + +extern int __pthread_nonstandard_stacks; + +/* The max size of the thread stack segments. If the default + THREAD_SELF implementation is used, this must be a power of two and + a multiple of PAGE_SIZE. */ +#ifndef STACK_SIZE +#define STACK_SIZE (2 * 1024 * 1024) +#endif + +/* Get some notion of the current stack. Need not be exactly the top + of the stack, just something somewhere in the current frame. */ +#ifndef CURRENT_STACK_FRAME +#define CURRENT_STACK_FRAME ({ char __csf; &__csf; }) +#endif + +/* Recover thread descriptor for the current thread */ + +extern pthread_descr __pthread_find_self (void) __attribute__ ((pure)); + +static __inline__ pthread_descr thread_self (void) __attribute__ ((pure)); +static __inline__ pthread_descr thread_self (void) +{ return (pthread_descr)(l4_utcb_tcr()->user[0]); } + +#endif /* descr.h */ diff --git a/l4/pkg/plr/lib/libpthread_romain/src/mutex.c b/l4/pkg/plr/lib/libpthread_romain/src/mutex.c index f3ef96b67..42fcf9e0e 100644 --- a/l4/pkg/plr/lib/libpthread_romain/src/mutex.c +++ b/l4/pkg/plr/lib/libpthread_romain/src/mutex.c @@ -14,6 +14,7 @@ /* Mutexes */ +#include "descr.h" #include #include #ifdef NOT_FOR_L4 @@ -31,11 +32,126 @@ #include +int pthread_mutex_lock_rep(pthread_mutex_t * mutex); +int pthread_mutex_unlock_rep(pthread_mutex_t * mutex); + + +#define LOCKli(li, mtx) (li)->locks[(mtx)->__m_reserved] +#define ACQ(li, mtx) lock_li( (li), (mtx)->__m_reserved) +#define REL(li, mtx) unlock_li((li), (mtx)->__m_reserved) + +#define YIELD() yield() +#define BARRIER() asm volatile ("" : : : "memory"); +#define ASSERT42(cond, msg) do { /*if (cond) enter_kdebug42(msg);*/ } while (0) + +#define GO_TO_SLEEP 0 + +/* + * The generated code uses registers to access and modify data in + * the lock info page. This page is shared between all replicas, but + * the counts written to it may differ between replicas, which in turn + * may lead to the master process detecting state deviation if the values + * remain in those registers. + * + * To fix that, we store the original values of EBX, ECX, and EDX in + * thread-private storage and restore them before we a) leave the function or + * b) perform a system call that would be observed by the master. + * + * XXX: This assumes that we will not cause a page fault or + * any other exception during execution, because then we might end + * up with differing register values as well. + */ +static inline void rep_function_save_regs(void) +{ + BARRIER(); + asm volatile ("mov %%ebx, %0\t\n" + "mov %%ecx, %1\t\n" + "mov %%edx, %2\t\n" + /* + "mov %%esi, %3\t\n" + "mov %%edi, %4\t\n"*/ + : "=m" (thread_self()->ebx), + "=m" (thread_self()->ecx), + "=m" (thread_self()->edx)/*, + "=m" (thread_self()->esi), + "=m" (thread_self()->edi)*/ + : + : "memory" + ); +} + + +static inline void rep_function_restore_regs(void) +{ + + BARRIER(); + asm volatile ("mov %0, %%ebx\t\n" + "mov %1, %%ecx\t\n" + "mov %2, %%edx\t\n" + /* + "mov %3, %%esi\t\n" + "mov %4, %%edi\t\n"*/ + : + : "m" (thread_self()->ebx), + "m" (thread_self()->ecx), + "m" (thread_self()->edx)/*, + "m" (thread_self()->esi), + "m" (thread_self()->edi)*/ + : "memory" + ); +} + +static inline int yield() +{ + rep_function_restore_regs(); + asm volatile ("ud2" : : : "edx", "ecx", "ebx", "memory"); + rep_function_save_regs(); +} + + +static inline void lock_rep_wait(pthread_mutex_t* mutex) +{ + /* + * Go to sleep. This is a system call and will be checked by the master. Therefore, + * we need to load the ECX and EDX values we pushed in the beginning, so that the + * master process sees a consistent state here. + */ + rep_function_restore_regs(); + asm volatile ( + "push %0\t\n" + "mov $0xA020, %%eax\t\n" + "call *%%eax\t\n" + "pop %0\t\n" + : + : "r" (mutex) + : "eax", "memory"); + rep_function_save_regs(); +} + + + +static inline void lock_rep_post(pthread_mutex_t* mutex) +{ + /* + * Send the actual notification. This is a special case in the master, + * because here only one replica performs the system call while all + * others continue untouched. + */ + BARRIER(); + asm volatile ("push %0\t\n" + "mov $0xA040, %%eax\t\n" + "call *%%eax\t\n" + "pop %0\t\n": : "r" (mutex) : "eax", "memory"); +} + + static void init_replica_mutex(pthread_mutex_t* mtx) { unsigned i = 0; lock_info* li = get_lock_info(); + rep_function_save_regs(); + /* * find either the respective lock (if it has been registered by another * replica yet) or a free slot to use @@ -67,14 +183,16 @@ static void init_replica_mutex(pthread_mutex_t* mtx) if (i >= NUM_LOCKS) { enter_kdebug("out of locks"); } + + rep_function_restore_regs(); } - -int pthread_mutex_lock_rep(pthread_mutex_t * mutex); int attribute_hidden pthread_mutex_lock_rep(pthread_mutex_t * mutex) { + rep_function_save_regs(); + /* * not initialized yet? -> happens for statically initialized * locks as those don't call mutex_init(). And as we need to @@ -85,127 +203,84 @@ pthread_mutex_lock_rep(pthread_mutex_t * mutex) init_replica_mutex(mutex); } - lock_info* li = get_lock_info(); - pthread_descr self = thread_self(); - if (!self) enter_kdebug("self == NULL"); - -#define LOCKli(li, mtx) (li)->locks[(mtx)->__m_reserved] - - /* - * The generated code uses ECX and EDX to access and modify data in - * the lock info page. This page is shared between all replicas, but - * the counts written to it may differ between replicas, which in turn - * may lead to the master process detecting state deviation if the values - * remain in those registers. - * - * To fix that, we store the original values of ECX and EDX to the stack - * and restore them before we a) leave the function or b) perform a system - * call that would be observed by the master. - * - * XXX: Ben points out that this only works if all the code - * below does not use any (%esp)-indirect addresses. - * I validated this for now. A proper solution would be - * to store these registers to some replica-private page. - * - * XXX: Furthermore, this assumes that we will not cause a page fault or - * any other exception during execution, because then we might end - * up with differing register values as well. - */ - asm volatile ("push %ecx\t\n" - "push %edx\t\n"); - -retry: - lock_li(li, mutex->__m_reserved); - - if (LOCKli(li, mutex).owner == lock_unowned) { - /* - * Case 1: The lock was previously unlocked. - * -> make ourselves the lock owner - * -> set acq_count to number of replicas - * (it is decremented in unlock()) - */ - LOCKli(li, mutex).owner = (l4_addr_t)self; - LOCKli(li, mutex).acq_count = li->replica_count; - asm volatile ("" : : : "memory"); - } else if (LOCKli(li, mutex).owner != (l4_addr_t)self) { - /* - * Case 2: someone else owns the lock - * -> best we can do is go to sleep - * -> XXX: maybe spinning with thread_yield - * would help even more? - */ - LOCKli(li, mutex).wait_count += 1; - unlock_li(li, mutex->__m_reserved); - - /* - * Go to sleep. This is a system call and will be checked by the master. Therefore, - * we need to load the ECX and EDX values we pushed in the beginning, so that the - * master process sees a consistent state here. - */ - asm volatile ("pop %%edx\t\n" - "pop %%ecx\t\n" - "push %0\t\n" - "mov $0xA020, %%eax\t\n" - "call *%%eax\t\n" - "pop %0\t\n" - "push %%ecx\t\n" - "push %%edx\t\n" - : : "r" (mutex) : "eax", "memory"); - - /* - * If we return from the call above, the previous lock - * owner signalled us. The locking protocol makes sure that - * the lock is not marked as unlocked, but instead appears - * to still belong to the old owner. - * - * If we are the first replica to exit the call - * (wait_count == replica count), we adjust the lock owner - * to be ourselves. - */ - lock_li(li, mutex->__m_reserved); - - LOCKli(li, mutex).wait_count -= 1; - - if (LOCKli(li, mutex).wake_count == li->replica_count) { - LOCKli(li, mutex).owner = (l4_addr_t)self; - LOCKli(li, mutex).acq_count = li->replica_count; - } - - LOCKli(li, mutex).wake_count -= 1; - - asm volatile ("" : : : "memory"); - unlock_li(li, mutex->__m_reserved); - } else if (LOCKli(li, mutex).owner == (l4_addr_t)self) { - /* - * Case 3: my thread group owns the lock, - * but i'm not the first to acquire it - */ - - /* Not so good case: If the wake count is larger than 0, this means that - * the current thread previously had acquired the lock, then called unlock, - * but not all replicas reached the end of unlock() yet. In this case a - * fast replica might already try to grab the lock again and find out that - * it is already the lock owner. In this case, the thread must not grab the - * lock, but instead release the CPU and retry at a later point in time. - */ - if (LOCKli(li, mutex).wake_count > 0) { - unlock_li(li, mutex->__m_reserved); - asm volatile ("ud2" : : : "memory"); - goto retry; - } - } - - unlock_li(li, mutex->__m_reserved); + unsigned retry_counter = 0; + lock_info* li = get_lock_info(); + thread_self()->p_epoch += 1; + + /*outstring("lock() "); outhex32(thread_self()->p_epoch); outstring("\n");*/ + + while (1) { + + ACQ(li, mutex); + + if (LOCKli(li, mutex).owner == lock_unowned) + { + ASSERT42(LOCKli(li, mutex).wait_count != 0, "wait count != 0"); + ASSERT42(LOCKli(li, mutex).acq_count != 0, "acq count != 0"); + ASSERT42(LOCKli(li, mutex).wake_count != 0, "wake count != 0"); + + LOCKli(li, mutex).owner = (l4_addr_t)thread_self(); + LOCKli(li, mutex).owner_epoch = thread_self()->p_epoch; + LOCKli(li, mutex).acq_count = li->replica_count; + break; + } + else if (LOCKli(li, mutex).owner == (l4_addr_t)thread_self()) + { + if (LOCKli(li, mutex).owner_epoch != thread_self()->p_epoch) { + //outchar42('.'); outchar42(' '); outhex42(thread_self()); + REL(li, mutex); + YIELD(); + continue; + + // XXX allow multiple subsequent lock acquisitions */ + /* + outhex42(LOCKli(li, mutex).owner_epoch); outchar42(' '); + outhex42(thread_self()->p_epoch); outchar42('\n'); + enter_kdebug42("epoch mismatch"); + */ + } + + break; + //enter_kdebug42("mtx owned by me"); + } + else + { + /* + * XXX: Spin for a short while? + */ +#if GO_TO_SLEEP + LOCKli(li, mutex).wait_count += 1; + REL(li, mutex); + + lock_rep_wait(mutex); + + ACQ(li, mutex); + + LOCKli(li, mutex).wake_count -= 1; + LOCKli(li, mutex).wait_count -= 1; + + if (LOCKli(li, mutex).wake_count == 0) { + ASSERT42(LOCKli(li, mutex).acq_count != 0, "acq count != 0"); + LOCKli(li, mutex).owner = (l4_addr_t)thread_self(); + LOCKli(li, mutex).owner_epoch = thread_self()->p_epoch; + LOCKli(li, mutex).acq_count = li->replica_count; + } + + REL(li, mutex); + break; -#if 1 - asm volatile ("pop %edx\t\n" - "pop %ecx\t\n"); +#else + REL(li, mutex); + YIELD(); + continue; #endif + //enter_kdebug42("mtx: other owner"); + } + } + + REL(li, mutex); -#undef LOCKli - - //enter_kdebug("acquired lock"); - + rep_function_restore_regs(); return 0; } @@ -216,67 +291,40 @@ int attribute_hidden pthread_mutex_unlock_rep(pthread_mutex_t * mutex) { -#define LOCKli(li, mtx) (li)->locks[(mtx)->__m_reserved] - - lock_info* li = get_lock_info(); - - /* - * See documentation at the beginning of pthread_mutex_lock_rep() - */ - asm volatile ("push %ecx\t\n" - "push %edx\t\n"); - - lock_li(li, mutex->__m_reserved); - - LOCKli(li, mutex).acq_count -= 1; - - /* - * All replicas are required to decrement the lock acquisition count. However, - * only the last replica to do so will actually wake up a sleeping thread. - */ - if (LOCKli(li, mutex).acq_count == 0) { - - // 1. send unlock notification if there are waiting threads - if (LOCKli(li, mutex).wait_count > 0) { - - /* - * The wake count is used to figure out how many replicas will - * exit their sleep() inside mutex_lock_rep(). See there. - */ + rep_function_save_regs(); + lock_info *li = get_lock_info(); + +retry2: + ACQ(li, mutex); + + ASSERT42(LOCKli(li, mutex).owner != (l4_addr_t)thread_self(), "unlock not by owner"); + ASSERT42(LOCKli(li, mutex).acq_count == 0, "acq count == 0"); + + LOCKli(li, mutex).acq_count -= 1; + if (LOCKli(li, mutex).acq_count == 0) { +#if GO_TO_SLEEP + if (LOCKli(li, mutex).wait_count != 0) { LOCKli(li, mutex).wake_count = li->replica_count; - - /* - * Send the actual notification. This is a special case in the master, - * because here only one replica performs the system call while all - * others continue untouched. - */ - asm volatile ("push %0\t\n" - "mov $0xA040, %%eax\t\n" - "call *%%eax\t\n" - "pop %0\t\n": : "r" (mutex) : "eax"); - /* Not resetting the owner here. We want to prevent other - * threads from grabbing the lock and instead leave the lock - * to the thread we just signalled. Therefore, this thread - * will need to set ownership directly. - */ + lock_rep_post(mutex); + /* don't reset owner */ } else { - // no waiters -> lock is free now LOCKli(li, mutex).owner = lock_unowned; - } - - asm volatile ("" : : : "memory"); - } - - unlock_li(li, mutex->__m_reserved); - - asm volatile ("pop %edx\t\n" - "pop %ecx\t\n"); - -#undef LOCKli + } +#else + LOCKli(li, mutex).owner = lock_unowned; +#endif + } + REL(li, mutex); + rep_function_restore_regs(); + + //if (thread_self()->p_epoch % 10 == 0) + // YIELD(); + return 0; } +#undef LOCKli int attribute_hidden diff --git a/l4/pkg/plr/lib/libuu/Makefile b/l4/pkg/plr/lib/libuu/Makefile new file mode 100644 index 000000000..2fd0f7c31 --- /dev/null +++ b/l4/pkg/plr/lib/libuu/Makefile @@ -0,0 +1,15 @@ +PKGDIR?= ../.. +L4DIR ?= $(PKGDIR)/../.. + +# the name of your library +TARGET = libuu.a + +PC_FILENAME = libuu + +# list your .c or .cc files here +SRC_C = uu.c +SRC_CC = + +REQUIRES_LIBS = zlib + +include $(L4DIR)/mk/lib.mk diff --git a/l4/pkg/plr/lib/libuu/uu.c b/l4/pkg/plr/lib/libuu/uu.c new file mode 100644 index 000000000..17796d756 --- /dev/null +++ b/l4/pkg/plr/lib/libuu/uu.c @@ -0,0 +1,271 @@ +/** + * \file ferret/examples/merge_mon/uu.c + * \brief UUencoding functions, mostly from jdb + * + * \date 14/12/2005 + * \author Martin Pohlack + */ +/* + * (c) 2005-2009 Technische Universität Dresden + * This file is part of TUD:OS and distributed under the terms of the + * GNU General Public License 2. + * Please see the COPYING-GPL-2 file for details. + */ + +/* ENC is the basic 1 character encoding function to make a char printing */ +#define ENC(c) ((c) ? ((c) & 077) + ' ': '`') + +#include +#include +#include +#include + +#include + +#include + +#define MIN(a, b) ((a)<(b)?(a):(b)) + +#define LINE_IN 45 + +static z_stream strm; + +/* Init. zlib data structures, available input data and start address + */ +static void init_z(size_t len, const void *start) +{ + int ret; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + ret = deflateInit2(&strm, Z_BEST_COMPRESSION, Z_DEFLATED, 15 + 16, 9, + Z_DEFAULT_STRATEGY); + assert(ret == Z_OK); + + strm.avail_in = len; + strm.next_in = (void *)start; // oh why ... +} + +static int get_next_chunk(void *dest, ssize_t n, int flush) +{ + int ret; + + strm.avail_out = n; + strm.next_out = dest; + ret = deflate(&strm, flush); + assert(ret != Z_STREAM_ERROR); + return n - strm.avail_out; +} + +static void update_in_data(const unsigned char * buf, size_t * len) +{ + if (strm.avail_in == 0 && *len != 0) + { + strm.avail_in = *len; + strm.next_in = (void *)buf; // oh why ... + *len = 0; + } +} + +void uu_dumpz(const char * filename, const unsigned char * s_buf, size_t len) +{ + unsigned int ch; + int n, ret; + const unsigned char *p_buf; + int out_i; + static unsigned char in[LINE_IN + 3]; // some spare zeros for uuencode + static unsigned char out[70]; + int flush = Z_NO_FLUSH; + + init_z(len, s_buf); + + // uuencode header + printf("begin 644 %s.gz\n", filename); + + while (1) + { + // get next line of data + n = get_next_chunk(in, LINE_IN, flush); + if (n < LINE_IN && flush == Z_NO_FLUSH) + { + flush = Z_FINISH; // time to clean up now + n += get_next_chunk(in + n, LINE_IN - n, flush); + } + else if (n == 0 && flush == Z_FINISH) + break; // no more data available, leave loop + memset(in + n, 0, sizeof(in) - n); + + // fill output buffer + out_i = 0; + // line length prefix + ch = ENC(n); + out[out_i++] = ch; + for (p_buf = in; n > 0; n -= 3, p_buf += 3) + { + ch = *p_buf >> 2; + ch = ENC(ch); + out[out_i++] = ch; + ch = ((*p_buf << 4) & 060) | ((p_buf[1] >> 4) & 017); + ch = ENC(ch); + out[out_i++] = ch; + ch = ((p_buf[1] << 2) & 074) | ((p_buf[2] >> 6) & 03); + ch = ENC(ch); + out[out_i++] = ch; + ch = p_buf[2] & 077; + ch = ENC(ch); + out[out_i++] = ch; + } + // skip this newline for log output + //out[out_i++] = '\n'; + out[out_i] = '\0'; + puts((char const*)out); // write it + } + + ret = deflateEnd(&strm); + assert(ret == Z_OK); + + // uuencode footer + printf("`\nend\n"); +} + +/* Also works in ring buffers with wrap-around + */ +void uu_dumpz_ringbuffer(const char * filename, + const void * _buffer, size_t buffer_len, + unsigned start_offset, size_t transfer_size) +{ + int ret; + unsigned char * buffer = (unsigned char *)_buffer; + static unsigned char in[LINE_IN + 3]; // some spare zeros for uuencode + static unsigned char out[70]; + int flush = Z_NO_FLUSH; + size_t first_len = MIN(transfer_size, buffer_len - start_offset); + + assert((unsigned)start_offset < buffer_len); + assert(transfer_size <= buffer_len); + + // init. zlib stream for first chunk + init_z(first_len, buffer + start_offset); + transfer_size -= first_len; + + // uuencode header + printf("begin 644 %s.gz\n", filename); + + while (1) + { + int out_i, n; + unsigned int ch; + const unsigned char * p_buf; + + // get next line of data + n = get_next_chunk(in, LINE_IN, flush); + update_in_data(buffer, &transfer_size); + if (n < LINE_IN && flush == Z_NO_FLUSH) + { + flush = Z_FINISH; // time to clean up now + n += get_next_chunk(in + n, LINE_IN - n, flush); + update_in_data(buffer, &transfer_size); + } + else if (n == 0 && flush == Z_FINISH) + break; // no more data available, leave loop + memset(in + n, 0, sizeof(in) - n); + + // fill output buffer + out_i = 0; + // line length prefix + ch = ENC(n); + out[out_i++] = ch; + for (p_buf = in; n > 0; n -= 3, p_buf += 3) + { + ch = *p_buf >> 2; + ch = ENC(ch); + out[out_i++] = ch; + ch = ((*p_buf << 4) & 060) | ((p_buf[1] >> 4) & 017); + ch = ENC(ch); + out[out_i++] = ch; + ch = ((p_buf[1] << 2) & 074) | ((p_buf[2] >> 6) & 03); + ch = ENC(ch); + out[out_i++] = ch; + ch = p_buf[2] & 077; + ch = ENC(ch); + out[out_i++] = ch; + } + // skip this newline for log output + //out[out_i++] = '\n'; + out[out_i] = '\0'; + puts((char const *)out); // write it + } + + ret = deflateEnd(&strm); + assert(ret == Z_OK); + + // uuencode footer + printf("`\nend\n"); +} + +#if 0 +void uu_dump(const char * filename, const buf_t * buf) +{ + unsigned int ch; + int n; + const unsigned char *p_buf; + unsigned char *s_buf = buf->start; + int out_i; + static unsigned char in[48]; + static unsigned char out[70]; + size_t len = buf->write_pos - buf->start; + + // debug + //printf("%hhx %hhx %hhx %hhx\n", ENC(8), ENC(64), ENC(4), ENC(2)); + + // uuencode header + printf("begin 644 %s\n", filename); + + while (len > 0) + { + // get next line of data + if (len >= LINE_IN) + { + n = LINE_IN; + } + else + { + n = len; + } + memcpy(in, s_buf, n); + memset(in + n, 0, sizeof(in) - n); + len -= n; + s_buf += n; + + // fill output buffer + out_i = 0; + // line length prefix + ch = ENC(n); + out[out_i++] = ch; + for (p_buf = in; n > 0; n -= 3, p_buf += 3) + { + ch = *p_buf >> 2; + ch = ENC(ch); + out[out_i++] = ch; + ch = ((*p_buf << 4) & 060) | ((p_buf[1] >> 4) & 017); + ch = ENC(ch); + out[out_i++] = ch; + ch = ((p_buf[1] << 2) & 074) | ((p_buf[2] >> 6) & 03); + ch = ENC(ch); + out[out_i++] = ch; + ch = p_buf[2] & 077; + ch = ENC(ch); + out[out_i++] = ch; + } + // skip this newline for log output + //out[out_i++] = '\n'; + out[out_i] = '\0'; + + // write it + puts(out); + } + + // uuencode footer + printf("`\nend\n"); +} +#endif diff --git a/l4/pkg/plr/patches/fiasco_ud2yield.diff b/l4/pkg/plr/patches/fiasco_ud2yield.diff new file mode 100644 index 000000000..8c03fa42c --- /dev/null +++ b/l4/pkg/plr/patches/fiasco_ud2yield.diff @@ -0,0 +1,69 @@ +diff --git a/src/kern/ia32/thread-ia32.cpp b/src/kern/ia32/thread-ia32.cpp +index d6fb000..7be482b 100644 +--- a/src/kern/ia32/thread-ia32.cpp ++++ b/src/kern/ia32/thread-ia32.cpp +@@ -30,6 +30,7 @@ EXTENSION class Thread + { + private: + static int (*int3_handler)(Trap_state*); ++ static int (*int42_handler)(Trap_state*); + }; + + +@@ -196,6 +197,26 @@ Thread::handle_slow_trap(Trap_state *ts) + ts->_err = 0; + } + ++ if (ts->_trapno == 6) ++ { ++ LOG_MSG_3VAL(current(), "UD2", dbg_id(), ts->ip(), 0); ++ ts->ip(ts->ip()+2); ++ //Sched_context::rq.current().invalidate_sched(); ++ switch_sched(sched(), &Sched_context::rq.current()); ++ schedule(); ++ goto success; ++ } ++ ++ if (ts->_trapno == 13 && ts->_err == 530 /* INT 0x42 */) ++ { ++ /*printf("Replica %lx bailout @ %lx\n", dbg_id(), ts->ip());*/ ++ ts->_trapno = 3; ++ ts->ip(ts->ip()+2); ++ if (int42_handler && int42_handler(ts)) ++ goto success; ++ goto generic_debug; ++ } ++ + if (send_exception(ts)) + goto success; + } +@@ -517,6 +538,7 @@ IMPLEMENTATION[ia32 || amd64]: + #include "terminate.h" + + int (*Thread::int3_handler)(Trap_state*); ++int (*Thread::int42_handler)(Trap_state*); + DEFINE_PER_CPU Per_cpu Thread::dbg_stack; + + STATIC_INITIALIZER_P (int3_handler_init, KDB_INIT_PRIO); +@@ -526,6 +548,7 @@ void + int3_handler_init() + { + Thread::set_int3_handler(Thread::handle_int3); ++ Thread::set_int42_handler(Thread::handle_int3); + } + + IMPLEMENT static inline NEEDS ["gdt.h"] +@@ -575,6 +598,13 @@ Thread::set_int3_handler(int (*handler)(Trap_state *ts)) + int3_handler = handler; + } + ++ ++PUBLIC static inline ++void ++Thread::set_int42_handler(int (*handler)(Trap_state *ts)) ++{ ++ int42_handler = handler; ++} + /** + * Default handle for int3 extensions if JDB is disabled. If the JDB is + * available, Jdb::handle_int3_threadctx is called instead. diff --git a/l4/pkg/plr/patches/l4sys_kdebug0x42.diff b/l4/pkg/plr/patches/l4sys_kdebug0x42.diff new file mode 100644 index 000000000..ca79de07c --- /dev/null +++ b/l4/pkg/plr/patches/l4sys_kdebug0x42.diff @@ -0,0 +1,72 @@ +Index: ../l4sys/include/ARCH-x86/kdebug.h +=================================================================== +--- ../l4sys/include/ARCH-x86/kdebug.h ++++ ../l4sys/include/ARCH-x86/kdebug.h +@@ -53,6 +53,13 @@ + 1: + #endif + ++#define enter_kdebug42(text) \ ++asm(\ ++ "int $0x42\n\t"\ ++ "jmp 1f \n\t"\ ++ ".ascii \"" text "\"\n\t"\ ++ "1: \n\t"\ ++ ) + /** + * Enter L4 kernel debugger (plain assembler version) + * \ingroup l4_debugger_api +@@ -111,6 +118,8 @@ + */ + L4_INLINE void + outchar(char c) L4_NOTHROW; ++L4_INLINE void ++outchar42(char c) L4_NOTHROW; + + /** + * Print character string +@@ -139,6 +148,8 @@ + */ + L4_INLINE void + outhex32(int number) L4_NOTHROW; ++L4_INLINE void ++outhex42(int number) L4_NOTHROW; + + /** + * Print 20 bit number (hexadecimal) +@@ -270,6 +281,17 @@ + ); + } + ++L4_INLINE void ++outchar42(char c) L4_NOTHROW ++{ ++ asm( ++ "int $0x42\n\t" ++ "cmpb $0,%%al \n\t" ++ : /* No output */ ++ : "a" (c) ++ ); ++} ++ + /* actually outstring is outcstring */ + L4_INLINE void + outstring(const char *text) L4_NOTHROW +@@ -311,6 +333,17 @@ + } + + L4_INLINE void ++outhex42(int number) L4_NOTHROW ++{ ++ asm( ++ "int $0x42\n\t" ++ "cmpb $5,%%al \n\t" ++ : /* No output */ ++ : "a" (number) ++ ); ++} ++ ++L4_INLINE void + outhex20(int number) L4_NOTHROW + { + asm( diff --git a/l4/pkg/plr/server/src/Makefile b/l4/pkg/plr/server/src/Makefile index 11d1862e0..509868716 100644 --- a/l4/pkg/plr/server/src/Makefile +++ b/l4/pkg/plr/server/src/Makefile @@ -12,6 +12,7 @@ OBSERVERS = $(addprefix fault_handlers/, \ observer.cc \ pagefault.cc \ print_vcpu_state.cc \ + replicalog.cc \ syscalls.cc \ swifi.cc \ trap_limit.cc \ @@ -46,6 +47,7 @@ SRC_CC = main.cc \ app_thread.cc \ handler.cc \ emulation.cc \ + logging.cc \ $(OBSERVERS) \ $(ASMJIT) @@ -56,7 +58,7 @@ SRC_CC = main.cc \ # list requirements of your program here REQUIRES_LIBS = libvcpu libstdc++ libloader libudis86 libiniparser libpthread \ - cxx_io libio-vbus + cxx_io libio-vbus libuu #REQUIRES_LIBS += lwip liblwip_netif_ankh include $(L4DIR)/mk/prog.mk diff --git a/l4/pkg/plr/server/src/app b/l4/pkg/plr/server/src/app index 9fb2d8377..564fe4bd0 100644 --- a/l4/pkg/plr/server/src/app +++ b/l4/pkg/plr/server/src/app @@ -5,7 +5,7 @@ * * Definitions of applications, instances * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -132,6 +132,7 @@ class App_instance l4_fpage_t fp = l4_fpage(local, shift, flags); //DEBUG() << "fp: " << fp.raw; l4_msgtag_t tag = vcpu_task()->map(L4Re::This_task, fp, remote); + _check(l4_msgtag_has_error(tag), "error mapping page"); //DEBUG() << "mapped " << std::hex << fp.raw << " : " << std::hex << tag.raw; for (unsigned offs = 0; offs < (L4_PAGESIZE << (shift - L4_PAGESHIFT)); offs += L4_PAGESIZE) { @@ -153,6 +154,7 @@ class App_instance while (size > 0) { unsigned frame_l = local_start >> L4_PAGESHIFT; unsigned frame_r = remote_start >> L4_PAGESHIFT; + (void)frame_l; (void)frame_r; unsigned shift = 0; /* Macro checks whether the size fits a given number of pages */ @@ -181,9 +183,8 @@ class App_instance fp.raw = fpraw; remote = l4_fpage_page(fp) << L4_PAGESHIFT; - //DEBUG() << "unmap @ " << std::hex << "0x" << remote; l4_addr_t a = _mappings[remote]; - //DEBUG() << std::hex << remote << " -> " << "0x" << a; + DEBUG() << "unmap @ " << std::hex << remote << " -> " << "0x" << a; vcpu_task()->unmap(l4_fpage(a, L4_PAGESIZE, L4_FPAGE_RO), L4_FP_ALL_SPACES); _mappings[remote] = 0; //enter_kdebug("unmapped"); diff --git a/l4/pkg/plr/server/src/app_loading b/l4/pkg/plr/server/src/app_loading index 6fd57e3cb..4adf06d6e 100644 --- a/l4/pkg/plr/server/src/app_loading +++ b/l4/pkg/plr/server/src/app_loading @@ -7,7 +7,7 @@ * Implementation of application loading. Similar to the stuff * moe and ned do. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/app_loading.cc b/l4/pkg/plr/server/src/app_loading.cc index e6aad63d7..e5e897a34 100644 --- a/l4/pkg/plr/server/src/app_loading.cc +++ b/l4/pkg/plr/server/src/app_loading.cc @@ -7,7 +7,7 @@ * Implementation of application loading. Similar to the stuff * moe and ned do. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -187,12 +187,8 @@ Romain::App_model::add_env() Romain::App_model::Dataspace Romain::App_model::alloc_ds(unsigned long size) const { - Dataspace ds = L4Re::Util::cap_alloc.alloc(); - _check(!ds.is_valid(), "ds cap allocation failed"); - - long r = L4Re::Env::env()->mem_alloc()->alloc(size, ds); - _check(r != 0, "dataspace allocation failed"); - + Dataspace ds; + Romain::Region_map::allocate_ds(&ds, size); return ds; } diff --git a/l4/pkg/plr/server/src/app_thread.cc b/l4/pkg/plr/server/src/app_thread.cc index a4f23d2a2..e318ee6d8 100644 --- a/l4/pkg/plr/server/src/app_thread.cc +++ b/l4/pkg/plr/server/src/app_thread.cc @@ -3,7 +3,7 @@ * * App_thread functions for creating and preparing a new VCPU * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -110,10 +110,10 @@ Romain::App_thread::csum_state() + _vcpu->r()->sp + _vcpu->r()->ax + _vcpu->r()->bx +#if 0 + _vcpu->r()->cx + _vcpu->r()->dx + _vcpu->r()->bp -#if 0 + _vcpu->r()->fs + _vcpu->r()->gs #endif diff --git a/l4/pkg/plr/server/src/configuration b/l4/pkg/plr/server/src/configuration index 00a4379f7..eedcd8408 100644 --- a/l4/pkg/plr/server/src/configuration +++ b/l4/pkg/plr/server/src/configuration @@ -6,7 +6,7 @@ * * Handling of Romain config stuff * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -74,10 +74,10 @@ struct ConfigIntValue : public ConfigValue struct ConfigStringValue : public ConfigValue { char const *_val; - ConfigStringValue(char const * const key, char *_default = 0) + ConfigStringValue(char const * const key, char const *_default = 0) : ConfigValue() { - _val = iniparser_getstring(_dict, key, _default); + _val = iniparser_getstring(_dict, key, const_cast(_default)); } operator char const *() { return _val; } diff --git a/l4/pkg/plr/server/src/constants.h b/l4/pkg/plr/server/src/constants.h index 4ced208fb..730655c75 100644 --- a/l4/pkg/plr/server/src/constants.h +++ b/l4/pkg/plr/server/src/constants.h @@ -5,7 +5,7 @@ * * Globally used constants * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -38,12 +38,14 @@ namespace Romain { enum { - MAX_REPLICAS = 3, // maximum # of allowed replicas - MAX_OBSERVERS = 16, // maximum # of fault observers - TRAMPOLINE_SIZE = 64, // size of the per-thread trampoline area - HANDLER_STACK_SIZE = (1 << 14), // size of the VCPU handler stack - DEBUG_ENTRIES = 1000, // dbg: # of 64bit entries in thread->_measurements - FIRST_REPLICA_CAP = 0x1000, // first replica cap markes as unused - LOCK_INFO_PAGE = 0xA000, // address the lock info page is mapped to in replicas + MAX_REPLICAS = 3, // maximum # of allowed replicas + MAX_OBSERVERS = 16, // maximum # of fault observers + TRAMPOLINE_SIZE = 64, // size of the per-thread trampoline area + HANDLER_STACK_SIZE = (1 << 14), // size of the VCPU handler stack + DEBUG_ENTRIES = 1000, // dbg: # of 64bit entries in thread->_measurements + FIRST_REPLICA_CAP = 0x1000, // first replica cap markes as unused + LOCK_INFO_PAGE = 0xA000, // address the lock info page is mapped to in replicas + REPLICA_TSC_ADDRESS = 0xC000, // start of replica-shared TSC buffer + REPLICA_LOG_ADDRESS = 0xB0000000, // start of replica log buffer (XXX: don't go lower -> KIP is there!) }; } diff --git a/l4/pkg/plr/server/src/emulation b/l4/pkg/plr/server/src/emulation index e7dbc2bd8..a08943aa6 100644 --- a/l4/pkg/plr/server/src/emulation +++ b/l4/pkg/plr/server/src/emulation @@ -7,7 +7,7 @@ * Basic definition of an instruction emulator. Used * by the framework to emulate memory write instructions. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/emulation.cc b/l4/pkg/plr/server/src/emulation.cc index b630ec152..63dd7292d 100644 --- a/l4/pkg/plr/server/src/emulation.cc +++ b/l4/pkg/plr/server/src/emulation.cc @@ -3,7 +3,7 @@ * * Implementation of the write instruction emulator. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/exceptions b/l4/pkg/plr/server/src/exceptions index 77d3a9e85..39855d6bc 100644 --- a/l4/pkg/plr/server/src/exceptions +++ b/l4/pkg/plr/server/src/exceptions @@ -6,7 +6,7 @@ * * Romain exception definitions. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -38,6 +38,10 @@ class Romain_error : public L4::Base_exception }; +/* + * XXX: Meh ... the use of the condition is actually opposite to what one would expect + * for a standard ASSERT. This drives me nuts. Need to fix it some day. + */ #define _check(cond, message) \ do { \ if (cond) { \ diff --git a/l4/pkg/plr/server/src/fault_handlers/debugger.cc b/l4/pkg/plr/server/src/fault_handlers/debugger.cc index 8bb6494b5..03fc127ef 100644 --- a/l4/pkg/plr/server/src/fault_handlers/debugger.cc +++ b/l4/pkg/plr/server/src/fault_handlers/debugger.cc @@ -7,7 +7,7 @@ * (simplegdb:singlestep). It will then place a breakpoint (0xCC) on this address * and once this BP is hit, start single-stepping from this point on. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/debugging.h b/l4/pkg/plr/server/src/fault_handlers/debugging.h index df980504d..4e08873f5 100644 --- a/l4/pkg/plr/server/src/fault_handlers/debugging.h +++ b/l4/pkg/plr/server/src/fault_handlers/debugging.h @@ -4,7 +4,7 @@ * * Debugging interface * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/kiptime.cc b/l4/pkg/plr/server/src/fault_handlers/kiptime.cc index 5708f35aa..0c5b72131 100644 --- a/l4/pkg/plr/server/src/fault_handlers/kiptime.cc +++ b/l4/pkg/plr/server/src/fault_handlers/kiptime.cc @@ -1,7 +1,7 @@ /* * kiptime.cc -- * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/lock_observer.cc b/l4/pkg/plr/server/src/fault_handlers/lock_observer.cc index c23bd0c76..af875d4a3 100644 --- a/l4/pkg/plr/server/src/fault_handlers/lock_observer.cc +++ b/l4/pkg/plr/server/src/fault_handlers/lock_observer.cc @@ -1,3 +1,15 @@ +/* + * lock_observer.cc -- + * + * Deterministic lock acquisition + * + * (c) 2012-2013 Björn Döbel , + * economic rights: Technische Universität Dresden (Germany) + * This file is part of TUD:OS and distributed under the terms of the + * GNU General Public License 2. + * Please see the COPYING-GPL-2 file for details. + */ + #include "lock_observer.h" #define DEBUGt(t) DEBUG() << "[" << t->vcpu() << "] " @@ -7,7 +19,17 @@ Romain::PThreadLockObserver::Create() { return new PThreadLock_priv(); } -void Romain::PThreadLock_priv::status() const { } +void Romain::PThreadLock_priv::status() const +{ + INFO() << "LOCK.lock = " << det_lock_count; + INFO() << "LOCK.unlock = " << det_unlock_count; + INFO() << "MTX.lock = " << mtx_lock_count; + INFO() << "MTX.unlock = " << mtx_unlock_count; + INFO() << "pt.lock = " << pt_lock_count; + INFO() << "pt.unlock = " << pt_unlock_count; + INFO() << "# ignored = " << ignore_count; + INFO() << "Total count = " << total_count; +} Romain::Observer::ObserverReturnVal @@ -20,15 +42,20 @@ Romain::PThreadLock_priv::notify(Romain::App_instance* inst, return Romain::Observer::Ignored; } + DEBUG() << "LOCK observer"; + l4util_inc32(&total_count); + /* * HACK: intercept notifications coming from the replication- * aware pthread library. */ if (thread->vcpu()->r()->ip == 0xA021) { + l4util_inc32(&det_lock_count); det_lock(inst, thread, group, model); //thread->vcpu()->r()->flags |= TrapFlag; return Romain::Observer::Replicatable; } else if (thread->vcpu()->r()->ip == 0xA041) { + l4util_inc32(&det_unlock_count); det_unlock(inst, thread, group, model); return Romain::Observer::Replicatable; } @@ -42,52 +69,72 @@ Romain::PThreadLock_priv::notify(Romain::App_instance* inst, HANDLE_BP(mutex_lock_id, mutex_lock); HANDLE_BP(mutex_unlock_id, mutex_unlock); - HANDLE_BP(mutex_init_id, mutex_init); + //HANDLE_BP(mutex_init_id, mutex_init); HANDLE_BP(pt_lock_id, lock); HANDLE_BP(pt_unlock_id, unlock); #undef HANDLE_BP + l4util_inc32(&ignore_count); return Romain::Observer::Ignored; } + +void Romain::PThreadLock_priv::attach_lock_info_page(Romain::App_model *am) +{ + _lip_ds = am->alloc_ds(L4_PAGESIZE); + _lip_local = am->local_attach_ds(_lip_ds, L4_PAGESIZE, 0); + INFO() << "Local LIP address: " << std::hex << _lip_local; + void* remote__lip = (void*)am->prog_attach_ds(Romain::LOCK_INFO_PAGE, + L4_PAGESIZE, _lip_ds, 0, 0, + "lock info page", + _lip_local, true); + _check(reinterpret_cast(remote__lip) != Romain::LOCK_INFO_PAGE, + "LIP did not attach to proper remote location"); + + am->lockinfo_local(_lip_local); + am->lockinfo_remote(Romain::LOCK_INFO_PAGE); + + memset((void*)_lip_local, 0, L4_PAGESIZE); +} + + void Romain::PThreadLock_priv::startup_notify(Romain::App_instance *inst, Romain::App_thread *, Romain::Thread_group *, Romain::App_model *am) { - static unsigned callCount = 0; - lock_info *lip = reinterpret_cast(_lip_local); + static unsigned callCount = 0; + lock_info *lip = reinterpret_cast(_lip_local); - if (!callCount) { #if INTERNAL_DETERMINISM - _lip_ds = am->alloc_ds(L4_PAGESIZE); - _lip_local = am->local_attach_ds(_lip_ds, L4_PAGESIZE, 0); - INFO() << "Local LIP address: " << std::hex << _lip_local; - lip = reinterpret_cast(_lip_local); - void* remote__lip = (void*)am->prog_attach_ds(Romain::LOCK_INFO_PAGE, - L4_PAGESIZE, _lip_ds, 0, 0, - "lock info page", - _lip_local, true); - - am->lockinfo_local(_lip_local); - am->lockinfo_remote(Romain::LOCK_INFO_PAGE); - - memset((void*)_lip_local, 0, L4_PAGESIZE); - - lip->locks[0].lockdesc = 0xFFFFFFFF; + if (!callCount) { + /* + * For internal determinism, we make sure that we only attach the + * lock info page once (for the first replica), because the LIP + * is shared across all replicas. + */ + attach_lock_info_page(am); + lip = reinterpret_cast(_lip_local); + lip->locks[0].lockdesc = 0xFAFAFAFA; lip->locks[0].owner = 0xDEADBEEF; #endif //DEBUG() << "Replica LIP address: " << std::hex << remote_lock_info; + /* + * Breakpoints / patching of function entries is only done once, + * because code is shared across all replicas. + */ for (unsigned idx = 0; idx < pt_max_wrappers; ++idx) { DEBUG() << idx; _functions[idx].activate(inst, am); } +#if INTERNAL_DETERMINISM } callCount++; lip->replica_count += 1; +#endif //enter_kdebug(); } @@ -131,6 +178,7 @@ void Romain::PThreadLock_priv::lock(Romain::App_instance *inst, Romain::Thread_group *tg, Romain::App_model *am) { + l4util_inc32(&pt_lock_count); l4_addr_t stack = am->rm()->remote_to_local(t->vcpu()->r()->sp, inst->id()); l4_umword_t ret = *(l4_umword_t*)stack; l4_umword_t lock = t->vcpu()->r()->ax; @@ -140,8 +188,6 @@ void Romain::PThreadLock_priv::lock(Romain::App_instance *inst, DEBUG() << "Lock @ " << std::hex << lock; DEBUG() << "Return addr " << std::hex << ret; - //enter_kdebug("lock"); - lookup_or_create(lock)->lock(tg); t->vcpu()->r()->sp += sizeof(l4_umword_t); // RET: inc. ESP @@ -159,6 +205,7 @@ void Romain::PThreadLock_priv::unlock(Romain::App_instance *inst, Romain::Thread_group *tg, Romain::App_model *am) { + l4util_inc32(&pt_unlock_count); l4_addr_t stack = am->rm()->remote_to_local(t->vcpu()->r()->sp, inst->id()); l4_umword_t retaddr = *(l4_umword_t*)stack; l4_umword_t lock = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t)); @@ -183,11 +230,13 @@ void Romain::PThreadLock_priv::unlock(Romain::App_instance *inst, void Romain::PThreadLock_priv::mutex_lock(Romain::App_instance* inst, Romain::App_thread* t, Romain::Thread_group* group, Romain::App_model* model) { + l4util_inc32(&mtx_lock_count); + l4_addr_t stack = model->rm()->remote_to_local(t->vcpu()->r()->sp, inst->id()); l4_umword_t retaddr = *(l4_umword_t*)stack; l4_umword_t lock = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t)); - //DEBUG() << "lock @ " << std::hex << lock << " ESP.local = " << stack; + DEBUG() << "lock @ " << std::hex << lock << " ESP.local = " << stack; PThreadMutex* mtx = _locks[lock]; if (!mtx) { /* @@ -217,6 +266,8 @@ void Romain::PThreadLock_priv::mutex_lock(Romain::App_instance* inst, Romain::Ap void Romain::PThreadLock_priv::mutex_unlock(Romain::App_instance* inst, Romain::App_thread* t, Romain::Thread_group* group, Romain::App_model* model) { + l4util_inc32(&mtx_unlock_count); + l4_addr_t stack = model->rm()->remote_to_local(t->vcpu()->r()->sp, inst->id()); l4_umword_t retaddr = *(l4_umword_t*)stack; l4_umword_t lock = *(l4_umword_t*)(stack + 1*sizeof(l4_umword_t)); diff --git a/l4/pkg/plr/server/src/fault_handlers/lock_observer.h b/l4/pkg/plr/server/src/fault_handlers/lock_observer.h index ac8e12501..64268b1b2 100644 --- a/l4/pkg/plr/server/src/fault_handlers/lock_observer.h +++ b/l4/pkg/plr/server/src/fault_handlers/lock_observer.h @@ -5,7 +5,7 @@ * * Deterministic lock acquisition * - * (c) 2012 Björn Döbel , + * (c) 2012-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -18,7 +18,9 @@ #define EXTERNAL_DETERMINISM 0 #define INTERNAL_DETERMINISM 1 +EXTERN_C_BEGIN #include +EXTERN_C_END namespace Romain { @@ -55,7 +57,7 @@ namespace Romain * which may not be the case due to replication). */ sem_init(&sem, 0, 1); - //pthread_mutex_init(&mtx, 0); + pthread_mutex_init(&mtx, 0); } @@ -64,18 +66,23 @@ namespace Romain */ int lock(Romain::Thread_group* tg) { + pthread_mutex_lock(&mtx); /* * If this is recursive, only increment the counter. */ if (recursive and counter) { - if (tg != owner) + if (tg != owner) { + pthread_mutex_unlock(&mtx); return 1; // EPERM + } counter++; + pthread_mutex_unlock(&mtx); return 0; } owner = tg; counter++; + pthread_mutex_unlock(&mtx); return sem_wait(&sem); //return pthread_mutex_lock(&mtx); @@ -87,11 +94,13 @@ namespace Romain */ int unlock() { + pthread_mutex_lock(&mtx); counter--; if (recursive and (counter == 0)) { owner = 0; } + pthread_mutex_unlock(&mtx); return sem_post(&sem); //return pthread_mutex_unlock(&mtx); @@ -139,7 +148,12 @@ namespace Romain do_patch(am); } #else + DEBUG() << lockID_to_str(function_id); + if ((orig_address == 0) or (orig_address == ~0)) + return; + bp = new Breakpoint(orig_address); bp->activate(inst, am); + DEBUG() << "BP set."; #endif } @@ -290,14 +304,29 @@ namespace Romain std::map _locks; Romain::App_model::Dataspace _lip_ds; l4_addr_t _lip_local; + pthread_mutex_t _tablemtx; + + unsigned /* Internal determinism counters */ + det_lock_count, // counter: det_lock + det_unlock_count, // counter: det_unlock + /* External determinism counters: */ + mtx_lock_count, // counter: pthread_mutex_lock + mtx_unlock_count, // counter: pthread_mutex_unlock + pt_lock_count, // counter: __pthread_lock + pt_unlock_count, // counter: __pthread_unlock + /* Global counter */ + ignore_count, // counter: call ignored + total_count; // counter: total invocations PThreadMutex* lookup_or_fail(unsigned addr) { + pthread_mutex_lock(&_tablemtx); PThreadMutex* r = _locks[addr]; if (!r) { ERROR() << "Called with uninitialized mutex?"; enter_kdebug("op on uninitialized mutex"); } + pthread_mutex_unlock(&_tablemtx); return r; } @@ -305,6 +334,7 @@ namespace Romain PThreadMutex* lookup_or_create(unsigned addr, bool init_locked = false, Romain::Thread_group* tg = 0) { + pthread_mutex_lock(&_tablemtx); PThreadMutex* mtx = _locks[addr]; if (!mtx) { mtx = new PThreadMutex(false); @@ -314,6 +344,7 @@ namespace Romain mtx->lock(tg); } } + pthread_mutex_unlock(&_tablemtx); return mtx; } @@ -327,7 +358,7 @@ namespace Romain l4_addr_t lock = *(l4_addr_t*)(stackaddr + 4); DEBUG() << "\033[35mLOCK @ \033[0m" << std::hex << lock; lookup_or_create(lock, true, tg)->lock(tg); - enter_kdebug("det_lock"); + //enter_kdebug("det_lock"); } @@ -340,21 +371,35 @@ namespace Romain l4_addr_t lock = *(l4_addr_t*)(stackaddr + 4); DEBUG() << "\033[35mUNLOCK @ \033[0m" << std::hex << lock; + pthread_mutex_lock(&_tablemtx); PThreadMutex* m = _locks[lock]; - while (!m) { - l4_thread_yield(); - m = _locks[lock]; + if (!m) { + /* This may actually happen! The unlocker is simply faster sending the + * notification than the locker is in sending his wakeup. Hence, + * we need to potentially create the respective lock here. + */ + l4_umword_t mtx_kind_ptr = am->rm()->remote_to_local(lock + 12, inst->id()); + m = new PThreadMutex(*(l4_umword_t*)mtx_kind_ptr == PTHREAD_MUTEX_RECURSIVE_NP); + _locks[lock] = m; } - - lookup_or_fail(lock)->unlock(); - enter_kdebug("det_unlock"); + pthread_mutex_unlock(&_tablemtx); + m->unlock(); + //enter_kdebug("det_unlock"); } + + void attach_lock_info_page(Romain::App_model *am); + public: PThreadLock_priv() + : det_lock_count(0), det_unlock_count(0), + mtx_lock_count(0), mtx_unlock_count(0), + pt_lock_count(0), pt_unlock_count(0), + ignore_count(0), total_count(0) { -#if 1 + pthread_mutex_init(&_tablemtx, 0); +#if 0 _functions[mutex_init_id].configure("threads:mutex_init", "threads:mutex_init_rep", mutex_init_id); diff --git a/l4/pkg/plr/server/src/fault_handlers/observer.cc b/l4/pkg/plr/server/src/fault_handlers/observer.cc index 013ddf1cf..17aeac0af 100644 --- a/l4/pkg/plr/server/src/fault_handlers/observer.cc +++ b/l4/pkg/plr/server/src/fault_handlers/observer.cc @@ -3,7 +3,7 @@ * * General fault observer functions * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -32,6 +32,7 @@ Romain::ObserverFactory::CreateObserver(char const *name) CASE("kip-time", KIPTimeObserver::Create()); CASE("trap_limit", TrapLimitObserver::Create()); CASE("threads", PThreadLockObserver::Create()); + CASE("replicalog", new ReplicaLogObserver()); #if 0 if (strcmp(name, "gdb") == 0) { diff --git a/l4/pkg/plr/server/src/fault_handlers/observers.h b/l4/pkg/plr/server/src/fault_handlers/observers.h index ddf407568..b60e52944 100644 --- a/l4/pkg/plr/server/src/fault_handlers/observers.h +++ b/l4/pkg/plr/server/src/fault_handlers/observers.h @@ -5,7 +5,7 @@ * * Fault observer interface * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -150,4 +150,21 @@ namespace Romain public: static PThreadLockObserver* Create(); }; + + + class ReplicaLogObserver : public Observer + { + DECLARE_OBSERVER("replica::log"); + + public: + ReplicaLogObserver(); + + private: + struct { + l4_addr_t local_addr; + } buffers[Romain::MAX_REPLICAS]; + + void map_eventlog(Romain::App_instance *i, int logsizeMB); + void dump_eventlog(unsigned id) const; + }; } diff --git a/l4/pkg/plr/server/src/fault_handlers/pagefault.cc b/l4/pkg/plr/server/src/fault_handlers/pagefault.cc index 78e4bd76e..2bb1a2bf2 100644 --- a/l4/pkg/plr/server/src/fault_handlers/pagefault.cc +++ b/l4/pkg/plr/server/src/fault_handlers/pagefault.cc @@ -18,6 +18,7 @@ #include "../app_loading" #include "../locking.h" #include "../configuration" +#include "syscalls_handler.h" #include "observers.h" @@ -60,6 +61,15 @@ Romain::PageFaultObserver::notify(Romain::App_instance *i, Romain::App_thread *t bool write_pf = vcpu->r()->err & 0x2; l4_addr_t pfa = vcpu->r()->pfa; + Measurements::GenericEvent *ev = Romain::_the_instance_manager->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)t->vcpu(); + ev->header.type = Measurements::Pagefault; + ev->data.pf.address = pfa; + ev->data.pf.rw = write_pf ? 1 : 0; + ev->data.pf.localbase = 0; + ev->data.pf.remotebase = 0; + MSGt(t) << (write_pf ? "\033[31mwrite\033[0m" : "\033[34;1mread\033[0m") << " page fault @ 0x" << std::hex << pfa; @@ -117,6 +127,8 @@ Romain::PageFaultObserver::notify(Romain::App_instance *i, Romain::App_thread *t } #undef MAX_MAP_SHIFT #endif + ev->data.pf.localbase = n->second.local_region(i->id()).start() + offset_in_region; + ev->data.pf.remotebase = n->first.start() + offset_in_region; i->map(n->second.local_region(i->id()).start() + offset_in_region, // local addr n->first.start() + offset_in_region, // remote addr diff --git a/l4/pkg/plr/server/src/fault_handlers/replicalog.cc b/l4/pkg/plr/server/src/fault_handlers/replicalog.cc new file mode 100644 index 000000000..a146cfaf7 --- /dev/null +++ b/l4/pkg/plr/server/src/fault_handlers/replicalog.cc @@ -0,0 +1,166 @@ +/* + * replicalog.cc -- + * + * Fault observer that attaches a magic event buffer + * (see measurements.h) to each replica and dumps the replicas' + * event buffers after the program terminates. + * + * (c) 2013 Björn Döbel , + * economic rights: Technische Universität Dresden (Germany) + * + * This file is part of TUD:OS and distributed under the terms of the + * GNU General Public License 2. + * Please see the COPYING-GPL-2 file for details. + */ + +#include "observers.h" +#include "../configuration" +#include "../memory" +#include "../manager" + +#include + +namespace Romain { + extern InstanceManager *_the_instance_manager; +} + +Romain::ReplicaLogObserver::ReplicaLogObserver() +{ + for (unsigned i = 0; i < Romain::MAX_REPLICAS; ++i) { + buffers[i].local_addr = 0; + } +} + + +void +Romain::ReplicaLogObserver::map_eventlog(Romain::App_instance *i, int logsizeMB) +{ + int size = logsizeMB << 20; + unsigned mapops = 0; + l4_addr_t local_map_addr = buffers[i->id()].local_addr; + l4_addr_t remote_map_addr = Romain::REPLICA_LOG_ADDRESS; + + /* 1. map the TSC shared page read-only */ + INFO() << "shared tsc @ " << Romain::_the_instance_manager->logbuf()->timestamp; + i->map_aligned(reinterpret_cast(Romain::_the_instance_manager->logbuf()->timestamp), + Romain::REPLICA_TSC_ADDRESS, L4_PAGESHIFT, L4_FPAGE_RO); + + /* Now initialize the shared event buffer */ + Measurements::EventBuf* buf = reinterpret_cast(buffers[i->id()].local_addr); + buf->index = 0; + buf->sharedTSC = true; + buf->set_buffer((unsigned char*)remote_map_addr + sizeof(Measurements::GenericEvent), (logsizeMB << 20) - sizeof(Measurements::GenericEvent)); + INFO() << buf->index << " " << buf->size << std::endl; + + while (size > 0) { + + unsigned sz, shift; + + if (size >= (4 << 20)) { // map 4 MB page + sz = L4_SUPERPAGESIZE; + shift = L4_SUPERPAGESHIFT; + } else { // map 4 kB page + sz = L4_PAGESIZE; + shift = L4_PAGESHIFT; + } + + i->map_aligned(local_map_addr, remote_map_addr, shift, L4_FPAGE_RW); + size -= sz; + local_map_addr += sz; + remote_map_addr += sz; + mapops += 1; + } + + INFO() << "Mapped to replica. Used " << mapops << " map() operations"; +} + + +void Romain::ReplicaLogObserver::startup_notify(Romain::App_instance *i, + Romain::App_thread *t, + Romain::Thread_group *tg, + Romain::App_model *a) +{ + static bool logregion_reserved = false; + + int logMB = ConfigIntValue("general:replicalogsize"); + if (logMB == -1) { // use general logbuf size if no specific size was set + logMB = ConfigIntValue("general:logbuf"); + } + + INFO() << "Replica log size: " << logMB << " MB"; + + /* Reserve the area at the replicas' RM. We map this buffer without going through + the official channels. */ + if (!logregion_reserved) { + a->rm()->attach_area(Romain::REPLICA_LOG_ADDRESS, logMB << 20, 0, L4_SUPERPAGESHIFT); + logregion_reserved = true; + } + + L4::Cap mem; + buffers[i->id()].local_addr = Romain::Region_map::allocate_and_attach(&mem, logMB << 20, 0, L4_SUPERPAGESHIFT); + INFO() << "Buffer for instance " << i->id() << " @ " << std::hex << buffers[i->id()].local_addr; + l4_touch_rw(reinterpret_cast(buffers[i->id()].local_addr), logMB << 20); + + map_eventlog(i, logMB); + + //enter_kdebug("LogObserver::startup"); +} + + +Romain::Observer::ObserverReturnVal +Romain::ReplicaLogObserver::notify(Romain::App_instance *i, + Romain::App_thread *t, + Romain::Thread_group *tg, + Romain::App_model *a) +{ + /* We don't handle any events. */ + return Romain::Observer::Ignored; +} + + +void +Romain::ReplicaLogObserver::dump_eventlog(unsigned id) const +{ + INFO() << "Dumping ... " << id; + + Measurements::EventBuf *buf = reinterpret_cast(buffers[id].local_addr); + INFO() << " event buffer @ " << std::hex << buf; + + char filename[32]; + snprintf(filename, 32, "replica%d.log", id); + + INFO() << "file: " << filename; + + unsigned oldest = buf->oldest(); + + INFO() << "oldest: " << oldest; + + l4_umword_t dump_start, dump_size; + if (!oldest) { + dump_start = 0; + dump_size = buf->index * sizeof(Measurements::GenericEvent); + } else { + dump_start = oldest * sizeof(Measurements::GenericEvent); + dump_size = buf->size * sizeof(Measurements::GenericEvent); + } + + /* buf addr is relocated in replica AS -> need to retransform */ + char *bufaddr = ((l4_addr_t)buf->buffer - Romain::REPLICA_LOG_ADDRESS) + (char*)buf; + + INFO() << "file: " << filename << " start " << dump_start << " size " << dump_size; + uu_dumpz_ringbuffer(filename, bufaddr, + buf->size * sizeof(Measurements::GenericEvent), + dump_start, dump_size); +} + + +void +Romain::ReplicaLogObserver::status() const +{ + for (unsigned i = 0; i < Romain::MAX_REPLICAS; ++i) { + if (buffers[i].local_addr != 0) { + dump_eventlog(i); + } + } + //enter_kdebug("LogObserver::status"); +} diff --git a/l4/pkg/plr/server/src/fault_handlers/swifi.h b/l4/pkg/plr/server/src/fault_handlers/swifi.h index c07e6a2a0..aec84a3e1 100644 --- a/l4/pkg/plr/server/src/fault_handlers/swifi.h +++ b/l4/pkg/plr/server/src/fault_handlers/swifi.h @@ -5,7 +5,7 @@ * * Fault observer for fault injection experiments * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/syscalls.cc b/l4/pkg/plr/server/src/fault_handlers/syscalls.cc index 25f35d19d..50282af60 100644 --- a/l4/pkg/plr/server/src/fault_handlers/syscalls.cc +++ b/l4/pkg/plr/server/src/fault_handlers/syscalls.cc @@ -3,7 +3,7 @@ * * Implementation of Romain syscall handling. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -67,6 +67,13 @@ Romain::SyscallObserver::notify(Romain::App_instance *i, l4_msgtag_t *tag = reinterpret_cast(&t->vcpu()->r()->ax); MSG() << "SYSENTER(" << tg->name << ") tag = " << std::hex << tag->label(); + Measurements::GenericEvent* ev = Romain::_the_instance_manager->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)t->vcpu(); + ev->header.type = Measurements::Syscall; + ev->data.sys.eip = t->vcpu()->r()->bx; + ev->data.sys.label = tag->label(); + /* * Fiasco-specific: * EBX is return address @@ -139,8 +146,18 @@ Romain::SyscallObserver::notify(Romain::App_instance *i, INFO() << "Instance " << i->id() << " exitting. Time " << "\033[33;1m" << tv.tv_sec << "." << tv.tv_usec << "\033[0m"; + + Measurements::GenericEvent* ev = Romain::_the_instance_manager->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)t->vcpu(); + ev->header.type = Measurements::Thread_stop; + Romain::_the_instance_manager->query_observer_status(); + + Romain::_the_instance_manager->logdump(); + if (1) enter_kdebug("*#^"); + nullhandler.proxy_syscall(i, t, tg, a); retval = Romain::Observer::Replicatable; } @@ -332,8 +349,10 @@ void Romain::SyscallObserver::handle_task(Romain::App_instance* i, l4_umword_t op = l4_utcb_mr_u(utcb)->mr[0] & L4_THREAD_OPCODE_MASK; switch(op) { case L4_TASK_UNMAP_OP: +#if 0 MSGt(t) << "unmap"; i->unmap(l4_utcb_mr_u(utcb)->mr[2]); +#endif break; case L4_TASK_CAP_INFO_OP: nullhandler.proxy_syscall(i,t,0,a); @@ -403,7 +422,7 @@ Romain::Scheduling::handle(Romain::App_instance* inst, Romain::Thread_group* group = theObjectFactory.thread_for_cap(cap); group->scheduler_run(t); } else { - enter_kdebug("run_thread != 1"); + //enter_kdebug("run_thread != 1"); SyscallHandler::proxy_syscall(inst, t, tg, am); } @@ -421,7 +440,6 @@ Romain::IrqHandler::handle(Romain::App_instance* inst, unsigned op = l4_utcb_mr_u(utcb)->mr[0]; unsigned label = l4_utcb_mr_u(utcb)->mr[1]; unsigned cap = t->vcpu()->r()->dx & L4_CAP_MASK; - l4_msgtag_t ret; L4::Cap irq(cap); diff --git a/l4/pkg/plr/server/src/fault_handlers/syscalls_factory.h b/l4/pkg/plr/server/src/fault_handlers/syscalls_factory.h index 559d40987..af80ac1ba 100644 --- a/l4/pkg/plr/server/src/fault_handlers/syscalls_factory.h +++ b/l4/pkg/plr/server/src/fault_handlers/syscalls_factory.h @@ -5,7 +5,7 @@ * * Implementation of the factory system call * - * (c) 2012 Björn Döbel , + * (c) 2012-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -64,7 +64,7 @@ class Factory : public SyscallHandler * made sure that all faults raised by these threads will be resolved, * because we cannot be sure if they run before or after any subsequent * code. */ - unsigned cnt = 0; + //unsigned cnt = 0; for (std::vector::const_iterator it = newgroup->threads.begin(); it != newgroup->threads.end(); ++it) { diff --git a/l4/pkg/plr/server/src/fault_handlers/syscalls_handler.h b/l4/pkg/plr/server/src/fault_handlers/syscalls_handler.h index 2b10c2daa..558b337a7 100644 --- a/l4/pkg/plr/server/src/fault_handlers/syscalls_handler.h +++ b/l4/pkg/plr/server/src/fault_handlers/syscalls_handler.h @@ -5,7 +5,7 @@ * * Interface for system call wrappers * - * (c) 2012 Björn Döbel , + * (c) 2012-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/trap_limit.cc b/l4/pkg/plr/server/src/fault_handlers/trap_limit.cc index 4c5f9503c..a1d36d139 100644 --- a/l4/pkg/plr/server/src/fault_handlers/trap_limit.cc +++ b/l4/pkg/plr/server/src/fault_handlers/trap_limit.cc @@ -4,7 +4,7 @@ * Observer counting traps and terminating the * application after a specified amount of calls. * - * (c) 2012 Björn Döbel , + * (c) 2012-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_handlers/trap_observer.cc b/l4/pkg/plr/server/src/fault_handlers/trap_observer.cc index 202ebe2d3..a95b0a358 100644 --- a/l4/pkg/plr/server/src/fault_handlers/trap_observer.cc +++ b/l4/pkg/plr/server/src/fault_handlers/trap_observer.cc @@ -5,7 +5,7 @@ * system calls. Also, this observer handles Fiasco JDB * traps. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/fault_observers b/l4/pkg/plr/server/src/fault_observers index 23bddfbff..ba5d969ec 100644 --- a/l4/pkg/plr/server/src/fault_observers +++ b/l4/pkg/plr/server/src/fault_observers @@ -7,7 +7,7 @@ * Definition of the generic fault handling class as well as * specific sub-classes. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -25,7 +25,7 @@ namespace Romain class App_model; class App_instance; class App_thread; - class Thread_group; + struct Thread_group; /* Make this a macro because every sub-class will have to define * these two virtual functions. diff --git a/l4/pkg/plr/server/src/gdb_stub/connection b/l4/pkg/plr/server/src/gdb_stub/connection index 9669e2a6a..65f3afcb4 100644 --- a/l4/pkg/plr/server/src/gdb_stub/connection +++ b/l4/pkg/plr/server/src/gdb_stub/connection @@ -5,7 +5,7 @@ * * Definition of external connectivity for the GDB server stub * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/gdb_stub/gdb.cc b/l4/pkg/plr/server/src/gdb_stub/gdb.cc index ae57eb7a5..9cc837e8b 100644 --- a/l4/pkg/plr/server/src/gdb_stub/gdb.cc +++ b/l4/pkg/plr/server/src/gdb_stub/gdb.cc @@ -3,7 +3,7 @@ * * GDB stub implemented on top of the Romain framework * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/gdb_stub/gdbserver b/l4/pkg/plr/server/src/gdb_stub/gdbserver index 02c464e50..dcbf6afd1 100644 --- a/l4/pkg/plr/server/src/gdb_stub/gdbserver +++ b/l4/pkg/plr/server/src/gdb_stub/gdbserver @@ -5,7 +5,7 @@ * * Definition of the GDB server stub * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/gdb_stub/serial_connection.cc b/l4/pkg/plr/server/src/gdb_stub/serial_connection.cc index 7f57c6968..a6e50dfd2 100644 --- a/l4/pkg/plr/server/src/gdb_stub/serial_connection.cc +++ b/l4/pkg/plr/server/src/gdb_stub/serial_connection.cc @@ -3,7 +3,7 @@ * * Connectivity through serial interface * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/gdb_stub/tcp_connection.cc b/l4/pkg/plr/server/src/gdb_stub/tcp_connection.cc index dffbea1f0..c55aa59a2 100644 --- a/l4/pkg/plr/server/src/gdb_stub/tcp_connection.cc +++ b/l4/pkg/plr/server/src/gdb_stub/tcp_connection.cc @@ -3,7 +3,7 @@ * * Connectivity through TCP/IP * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/handler.cc b/l4/pkg/plr/server/src/handler.cc index a42c385b8..ea5930a82 100644 --- a/l4/pkg/plr/server/src/handler.cc +++ b/l4/pkg/plr/server/src/handler.cc @@ -3,7 +3,7 @@ * * Here's where the real stuff is going on * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -15,11 +15,13 @@ #include "exceptions" #include "emulation" #include "app_loading" +#include "fault_handlers/syscalls_handler.h" #include #include #include +#include #include #include @@ -28,6 +30,8 @@ #define MSGi(inst) MSG() << "[" << (inst)->id() << "] " #define MSGit(inst,tg) MSG() << "[" << (inst)->id() << "] \033[34;1m{" << tg->name << "}\033[0m " +#define ____dummy " /* ST2 highlighting fix XXX */ + EXTERN_C void *pthread_fn(void *data); EXTERN_C void *pthread_fn(void *data) { @@ -302,7 +306,7 @@ EXTERN_C void *split_handler_fn(void* data) #endif // SPLIT_HANDLING -void __attribute__((noreturn)) Romain::InstanceManager::VCPU_startup(Romain::InstanceManager *, +void __attribute__((noreturn)) Romain::InstanceManager::VCPU_startup(Romain::InstanceManager *m, Romain::App_instance *i, Romain::App_thread *t, Romain::Thread_group *tg, @@ -332,6 +336,11 @@ void __attribute__((noreturn)) Romain::InstanceManager::VCPU_startup(Romain::Ins MSGit(i,tg) << "Resuming instance @ " << (void*)vcpu->r()->ip << " ..."; + Measurements::GenericEvent* ev = m->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)vcpu; + ev->header.type = Measurements::Thread_start; + L4::Cap cap = t->vcpu_cap(); cap->vcpu_resume_commit(cap->vcpu_resume_start()); @@ -364,6 +373,12 @@ static void local_vCPU_handling(Romain::InstanceManager *m, MSGit(i,tg) << "\033[33;1mTRAP 0x" << std::hex << vcpu->r()->trapno << " @ 0x" << vcpu->r()->ip << "\033[0m"; + if (t->vcpu()->r()->ip == 0xA041) { + m->fault_notify(i,t,tg,a); + break; + } + +#if 0 /* * HACK: In case we are using lock-internal determinism, there's a special * entry address in which a single replica will signal us if we need @@ -376,6 +391,7 @@ static void local_vCPU_handling(Romain::InstanceManager *m, m->fault_notify(i,t,tg,a); break; } +#endif Romain::Observer::ObserverReturnVal v = Romain::Observer::Invalid; @@ -501,6 +517,14 @@ void __attribute__((noreturn)) Romain::InstanceManager::VCPU_handler(Romain::Ins vcpu->state()->clear(L4_VCPU_F_EXCEPTIONS | L4_VCPU_F_DEBUG_EXC); handler_prolog(t); + Measurements::GenericEvent* ev = m->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)vcpu; + ev->header.type = Measurements::Trap; + ev->data.trap.start = 1; + ev->data.trap.trapaddr = vcpu->r()->ip; + ev->data.trap.trapno = vcpu->r()->trapno; + #if MIGRATE_VCPU migrated_vCPU_handling(m, i, t, tg, a); #elif SPLIT_HANDLING @@ -511,6 +535,13 @@ void __attribute__((noreturn)) Romain::InstanceManager::VCPU_handler(Romain::Ins #error No vCPU handling method selected! #endif + ev = m->logbuf()->next(); + ev->header.tsc = Romain::_the_instance_manager->logbuf()->getTime(Log::logLocalTSC); + ev->header.vcpu = (l4_uint32_t)vcpu; + ev->header.type = Measurements::Trap; + ev->data.trap.start = 0; + ev->data.trap.trapno = ~0U; + L4::Cap self; self->vcpu_resume_commit(self->vcpu_resume_start()); diff --git a/l4/pkg/plr/server/src/locking.h b/l4/pkg/plr/server/src/locking.h index 2047e40ac..557d60bbb 100644 --- a/l4/pkg/plr/server/src/locking.h +++ b/l4/pkg/plr/server/src/locking.h @@ -4,7 +4,7 @@ * * Global locking stuff * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/log b/l4/pkg/plr/server/src/log index 16f9cd4df..8c24a7e20 100644 --- a/l4/pkg/plr/server/src/log +++ b/l4/pkg/plr/server/src/log @@ -6,7 +6,7 @@ * * Logging. Main ideas from http://www.drdobbs.com/cpp/201804215 * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -65,6 +65,8 @@ class Log static LogLevel maxLog; static bool withtime; static l4_umword_t logFlags; + static bool logLocalTSC; + static bool replicaLogBuf; Log() { } diff --git a/l4/pkg/plr/server/src/logging.cc b/l4/pkg/plr/server/src/logging.cc new file mode 100644 index 000000000..966e83567 --- /dev/null +++ b/l4/pkg/plr/server/src/logging.cc @@ -0,0 +1,56 @@ +#include "log" +#include +#include +#include +#include +#include +#include +#include +#include + +using L4Re::chksys; + +struct timerArgs +{ + unsigned cpu; + l4_addr_t timer; +}; + + +static timerArgs global_arg; + +void *timerThread(void *argp) +{ + char const *name = "Romain::timer"; + L4::Cap self(pthread_getl4cap(pthread_self())); + l4_debugger_set_object_name(self.cap(), name); + + l4_sched_param_t sp = l4_sched_param(2); + sp.affinity = l4_sched_cpu_set(global_arg.cpu, 0); + chksys(L4Re::Env::env()->scheduler()->run_thread(self, sp)); + + INFO() << "Timer thread. CPU " << global_arg.cpu << ". Timestamp @ 0x" << std::hex << global_arg.timer; + + while (1) { + *((volatile l4_uint64_t*)global_arg.timer) = l4_rdtsc(); + } + + enter_kdebug("timer returned"); + + return 0; +} + +void +Measurements::EventBuf::launchTimerThread(l4_addr_t timer, unsigned CPU) +{ + pthread_t tmr; + + global_arg.timer = timer; + global_arg.cpu = CPU; + + int err = pthread_create(&tmr, 0, timerThread, (void*)&global_arg); + if (err) { + ERROR() << "Error creating timer thread: " << err; + enter_kdebug(); + } +} diff --git a/l4/pkg/plr/server/src/main.cc b/l4/pkg/plr/server/src/main.cc index 6000a535a..255e052df 100644 --- a/l4/pkg/plr/server/src/main.cc +++ b/l4/pkg/plr/server/src/main.cc @@ -3,7 +3,7 @@ * * Main program entry point. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -27,6 +27,8 @@ using L4Re::chkcap; Romain::Log::LogLevel Romain::Log::maxLog = Romain::Log::INFO; l4_umword_t Romain::Log::logFlags = Romain::Log::None; bool Romain::Log::withtime = false; +bool Romain::Log::logLocalTSC = false; +bool Romain::Log::replicaLogBuf = false; namespace Romain { l4re_aux_t* l4re_aux; @@ -57,6 +59,12 @@ static int _main(int argc, char const **argv) (void)argc; (void)argv; INFO() << "FILE: " << argv[1]; + sleep(2); + + struct timeval tv; + gettimeofday(&tv, NULL); + srandom(tv.tv_usec); + setup_aux(argc, argv); Romain::_the_instance_manager = new Romain::InstanceManager(argc-1, &argv[1]); diff --git a/l4/pkg/plr/server/src/manager b/l4/pkg/plr/server/src/manager index a142c8fd4..3d28fe316 100644 --- a/l4/pkg/plr/server/src/manager +++ b/l4/pkg/plr/server/src/manager @@ -6,7 +6,7 @@ * Definition of the instance manager that knows about all * redundant VCPUs as well as the fault observers. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -29,6 +29,7 @@ #include #include "redundancy.h" +#include #if SPLIT_HANDLING EXTERN_C void *split_handler_fn(void*); @@ -60,6 +61,8 @@ namespace Romain unsigned _argc; // client argc char const **_argv; // argv of the client + Measurements::EventBuf *_logBuf; + #if SPLIT_HANDLING pthread_t _split_handler; // resilient core handler thread #endif // SPLIT_HANDLING @@ -81,6 +84,7 @@ namespace Romain void configure_logflags(char *flags); void configure_fault_observers(); void configure_redundancy(); + void configure_logbuf(int size); public: InstanceManager(unsigned argc, char const **argv, unsigned num_instances = 1); @@ -195,6 +199,9 @@ namespace Romain unsigned instance_count() const { return _num_inst; } + Measurements::EventBuf* logbuf() { return _logBuf; } + void logdump(); + static void VCPU_handler(Romain::InstanceManager *m, Romain::App_instance *i, Romain::App_thread *t, Romain::Thread_group* tg, Romain::App_model *a); static void VCPU_startup(Romain::InstanceManager *m, Romain::App_instance *i, Romain::App_thread *t, Romain::Thread_group* tg, Romain::App_model *a); diff --git a/l4/pkg/plr/server/src/manager.cc b/l4/pkg/plr/server/src/manager.cc index 87fa78efb..58d7746b9 100644 --- a/l4/pkg/plr/server/src/manager.cc +++ b/l4/pkg/plr/server/src/manager.cc @@ -3,7 +3,7 @@ * * Instance manager implementation. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -15,12 +15,19 @@ #include "configuration" #include +#include +#include +#include +#include +#include +#include #define MSG() DEBUGf(Romain::Log::Manager) #include "fault_handlers/syscalls_factory.h" Romain::Configuration Romain::globalconfig; + L4_INLINE unsigned countbits(long v) { v = v - ((v >> 1) & 0x55555555); // reuse input as temporary @@ -28,19 +35,21 @@ L4_INLINE unsigned countbits(long v) return ((v + ((v >> 4) & 0xF0F0F0F)) * 0x1010101) >> 24; // count } + L4_INLINE l4_umword_t count_online_cpus() { - l4_umword_t ret; - l4_sched_cpu_set_t set = l4_sched_cpu_set(0, 0); - if (l4_error(L4Re::Env::env()->scheduler()->info(&ret, &set)) < 0) { + l4_umword_t maxcpu = 0; + l4_sched_cpu_set_t cpuonline = l4_sched_cpu_set(0, 0); + if (l4_error(L4Re::Env::env()->scheduler()->info(&maxcpu, &cpuonline)) < 0) { ERROR() << "reading CPU info"; } - ret = countbits(set.map); - INFO() << "Found " << ret << " CPUs."; - return ret; + INFO() << "Online " << countbits(cpuonline.map) << " / MAX " << maxcpu; + + return countbits(cpuonline.map) > maxcpu ? maxcpu : countbits(cpuonline.map); } + Romain::InstanceManager::InstanceManager(unsigned int argc, char const **argv, unsigned num_instances) @@ -50,7 +59,8 @@ Romain::InstanceManager::InstanceManager(unsigned int argc, _num_inst(num_instances), _num_cpu(1), _argc(argc), // XXX: remove - _argv(argv) // XXX: remove + _argv(argv), // XXX: remove + _logBuf(0) { configure(); @@ -145,6 +155,7 @@ void Romain::InstanceManager::configure_fault_observers() StringObserverConfig("general:debug", this); BoolObserverConfig("general:intercept_kip", this, "kip-time"); BoolObserverConfig("general:swifi", this, "swifi"); + BoolObserverConfig("general:logreplica", this, "replicalog"); } @@ -165,6 +176,21 @@ void Romain::InstanceManager::configure_redundancy() } } + +void Romain::InstanceManager::configure_logbuf(int sizeMB) +{ + INFO() << "Log buffer size: " << sizeMB << " MB requested."; + unsigned size_in_bytes = sizeMB << 20; + + L4::Cap ds; + + l4_addr_t addr = Romain::Region_map::allocate_and_attach(&ds, size_in_bytes, 0, L4_SUPERPAGESHIFT); + INFO() << "Log buffer attached to 0x" << std::hex << addr; + + _logBuf->set_buffer(reinterpret_cast(addr), size_in_bytes); +} + + /* * Romain ini file settings * ===================== @@ -204,6 +230,30 @@ void Romain::InstanceManager::configure_redundancy() * - gdb -> GDB stub logging * - all -> everything * + * logbuf [int] (-1) + * - establish a log buffer with the given size in MB + * - runtime events are logged into this buffer and can later + * be dumped for postprocessing -> this is an alternative to + * printing a lot of stuff to the serial console + * + * logcpu [int] + * - event generation needs a global timestamp. On real SMP hardware + * CPUs disagree on their local TSC values. As a workaround, we start + * a dedicated thread that busily writes its local TSC to a global timer + * variable that is then read by everyone else. This of course requires + * the thread to solely run on a dedicated CPU. This option sets the + * respective CPU #. + * + * logrdtsc [bool] (false) + * - use local TSC instead of global time stamp counter for event timestamps + * -> use on Qemu where a dedicated timestamp thread does not work properly + * + * logreplica [bool] (false) + * - assign each replica a log buffer (mapped to REPLICA_LOG_ADDRESS) + * + * replicalogsize [int] (-1) + * - buffser size for the replica-specific log buffer + * * swifi [bool] (false) * - Perform fault injection experiments, details are configured * in the [swifi] section. @@ -272,6 +322,39 @@ void Romain::InstanceManager::configure_redundancy() */ void Romain::InstanceManager::configure() { +#define USE_SHARABLE_TIMESTAMP 1 + + int logMB = ConfigIntValue("general:logbuf"); + +#if USE_SHARABLE_TIMESTAMP + _logBuf = new Measurements::EventBuf(true); + L4::Cap tsds; + l4_addr_t ts_addr = Romain::Region_map::allocate_and_attach(&tsds, L4_PAGESIZE); + l4_touch_ro((void*)ts_addr, L4_PAGESIZE); + _logBuf->set_tsc_buffer(reinterpret_cast(ts_addr)); +#else + _logBuf = new Measurements::EventBuf(); +#endif + if (logMB != -1) { + configure_logbuf(logMB); + } + + Log::logLocalTSC = ConfigBoolValue("general:logrdtsc", false); + + /* + * These modes are exclusive: either we use the local TSC _xor_ we start a + * timer thread on a dedicated CPU. + */ + if (!Log::logLocalTSC) { + int logCPU = ConfigIntValue("general:logcpu"); + if (logCPU != -1) { + INFO() << "Starting counter thread on CPU " << logCPU; + INFO() << "Timestamp @ 0x" << std::hex << (l4_addr_t)_logBuf->timestamp; + Measurements::EventBuf::launchTimerThread((l4_addr_t)_logBuf->timestamp, + logCPU); + } + } + char *log = strdup(ConfigStringValue("general:log", "none")); configure_logflags(log); @@ -283,6 +366,30 @@ void Romain::InstanceManager::configure() } +void Romain::InstanceManager::logdump() +{ + int logMB = ConfigIntValue("general:logbuf"); + if (logMB != -1) { + char const *filename = "sampledump.txt"; + + unsigned oldest = _logBuf->oldest(); + unsigned dump_start, dump_size; + + if (oldest == 0) { // half-full -> dump from 0 to index + dump_start = 0; + dump_size = _logBuf->index * sizeof(Measurements::GenericEvent); + } else { // buffer completely full -> dump full size starting from oldest entry + dump_start = oldest * sizeof(Measurements::GenericEvent); + dump_size = _logBuf->size * sizeof(Measurements::GenericEvent); + } + + uu_dumpz_ringbuffer(filename, _logBuf->buffer, + _logBuf->size * sizeof(Measurements::GenericEvent), + dump_start, dump_size); + } +} + + /* * Prepare the stack that is used by the fault handler whenever a * VCPU enters the master task. @@ -340,7 +447,23 @@ Romain::InstanceManager::create_thread(l4_umword_t eip, l4_umword_t esp, */ if (_num_cpu > 1) { INFO() << instance_id << " " << (instance_id+1) % _num_cpu << " " << _num_cpu; - at->cpu((instance_id + 1) % _num_cpu); + + /* XXX REPLICAS PER CPU XXX */ + at->cpu(group->uid % _num_cpu); + + /* XXX INSTANCES PER CPU XXX */ + //at->cpu((instance_id + 1) % _num_cpu); + + /* XXX OVERLAPPING REPLICAS XXX */ + //at->cpu((group->uid + instance_id) % _num_cpu); + + /* XXX RANDOM PLACEMENT XXX */ + //at->cpu(random() % _num_cpu); + + /* XXX Threads assigned RR to CPUs */ + //static int threadcount = 1; + //at->cpu(threadcount % _num_cpu); + //threadcount++; } else { at->cpu(0); } diff --git a/l4/pkg/plr/server/src/memory b/l4/pkg/plr/server/src/memory index 3927f45f3..d7e47a2a8 100644 --- a/l4/pkg/plr/server/src/memory +++ b/l4/pkg/plr/server/src/memory @@ -5,7 +5,7 @@ * * Memory management classes, mirroring the L4 RM's ones. * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -145,13 +145,14 @@ namespace Romain }; private: - l4_cap_idx_t _cap; - Romain::Region _local_regions[Romain::MAX_REPLICAS]; - l4_addr_t _offs; - DS _mem[Romain::MAX_REPLICAS]; - unsigned char _flags; - RegionWritableType _row; - bool _shared; + l4_cap_idx_t _cap; // capability of the underlying dataspace + Romain::Region _local_regions[Romain::MAX_REPLICAS]; // replicated regions (writable regions exist in + // multiple instances) + l4_addr_t _offs; // offset in DS + DS _mem[Romain::MAX_REPLICAS]; // DS capabilities of underlying dataspaces + unsigned char _flags; // region flags + RegionWritableType _row; // rw state + bool _shared; // is DS shared across all replicas (true for internal determinism's lock info page) public: @@ -310,18 +311,12 @@ namespace Romain { if (orig_id == inst_id) return true; - L4::Cap mem = L4Re::Util::cap_alloc.alloc(); - _check(!mem.is_valid(), "could not allocate ds cap?"); - + L4::Cap mem; unsigned long size = r.local_region(orig_id).size(); - int ret = L4Re::Env::env()->mem_alloc()->alloc(size, mem); - _check(ret != 0, "memory allocation failed"); - l4_addr_t a = 0; - ret = L4Re::Env::env()->rm()->attach(&a, size, - L4Re::Rm::Search_addr, - mem, 0); - _check(ret != 0, "attach failed"); + l4_addr_t a = Romain::Region_map::allocate_and_attach(&mem, size); + _check(a == 0, "DS allocation failed"); + memcpy((void*)a, (void*)r.local_region(orig_id).start(), size); //DEBUG() << "COPY: DS " << std::hex << mem.cap() << " SIZE " << size @@ -333,6 +328,37 @@ namespace Romain } + /* + * Allocate a master-local dataspace object. + */ + static void + allocate_ds(L4::Cap *cap, unsigned size) + { + *cap = L4Re::Util::cap_alloc.alloc(); + _check(!cap->is_valid(), "error allocating DS capability"); + + int error = L4Re::Env::env()->mem_alloc()->alloc(size, *cap); + _check(error != 0, "error allocating memory"); + } + + + /* + * Allocate and attach a master-local dataspace object. + */ + static l4_addr_t + allocate_and_attach(L4::Cap *cap, unsigned size, + unsigned offs = 0, unsigned align = L4_PAGESHIFT) + { + Romain::Region_map::allocate_ds(cap, size); + + l4_addr_t a = 0; + int error = L4Re::Env::env()->rm()->attach(&a, size, L4Re::Rm::Search_addr, *cap, offs, align); + _check(error != 0, "attach failed"); + + return a; + } + + /* * Check if a node already has a mapping to one of the replicas. If so, * take a shortcut mapping to the next one (determined by inst parameter). diff --git a/l4/pkg/plr/server/src/memory.cc b/l4/pkg/plr/server/src/memory.cc index 0b689a3ad..00ba7913b 100644 --- a/l4/pkg/plr/server/src/memory.cc +++ b/l4/pkg/plr/server/src/memory.cc @@ -3,7 +3,7 @@ * * Memory management implementation * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -173,11 +173,9 @@ void *Romain::Region_map::attach_locally(void* addr, unsigned long size, */ if (!(dsstat.flags & L4Re::Dataspace::Map_rw)) { //MSG() << "Copying to rw dataspace."; - L4::Cap mem = L4Re::Util::cap_alloc.alloc(); - _check(!mem.is_valid(), "could not alloc ds cap"); - //MSG() << " mem_alloc(" << eff_size << ", " << std::hex << mem.cap() << ")"; - r = L4Re::Env::env()->mem_alloc()->alloc(eff_size, mem); - _check(r != 0, "memory allocation failed"); + L4::Cap mem; + + Romain::Region_map::allocate_ds(&mem, eff_size); mem->copy_in(0, *ds, page_base, hdlr->offset() + size); ds = &mem; // taking pointer to stack?? XXX @@ -219,10 +217,7 @@ void *Romain::Region_map::attach(void* addr, unsigned long size, void *ret = 0; Romain::Region_handler _handler(hdlr); - if (shared) { - //DEBUG() << "======> SHARED <======"; - _handler.shared(true); - } + _handler.shared(shared); /* Only attach locally, if this hasn't been done beforehand yet. */ if (!_handler.local_region(_active_instance).start()) { diff --git a/l4/pkg/plr/server/src/redundancy.h b/l4/pkg/plr/server/src/redundancy.h index 2846744ef..7eb20cf06 100644 --- a/l4/pkg/plr/server/src/redundancy.h +++ b/l4/pkg/plr/server/src/redundancy.h @@ -5,7 +5,7 @@ * * Interface for handling redundancy comparisons * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. diff --git a/l4/pkg/plr/server/src/redundancy/dmr.cc b/l4/pkg/plr/server/src/redundancy/dmr.cc index e6f3755ff..1fb02d5d7 100644 --- a/l4/pkg/plr/server/src/redundancy/dmr.cc +++ b/l4/pkg/plr/server/src/redundancy/dmr.cc @@ -3,7 +3,7 @@ * * n-way modular redundancy implementation * - * (c) 2011-2012 Björn Döbel , + * (c) 2011-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -14,6 +14,8 @@ #include "../redundancy.h" #include "../app_loading" #include "../fault_observers" +#include "../manager" +#include "../fault_handlers/syscalls_handler.h" #define MSG() DEBUGf(Romain::Log::Redundancy) #define MSGi(inst) MSG() << "[" << (inst)->id() << "] " @@ -48,7 +50,7 @@ */ Romain::DMR::DMR(unsigned instances) - : _leave_count(0), _enter_count(0), _block_count(0), + : _enter_count(0), _leave_count(0), _block_count(0), _rv(Romain::RedundancyCallback::Invalid), _num_instances(instances), _num_instances_bak(0) { @@ -116,7 +118,8 @@ Romain::DMR::checksum_replicas() if (_orig_vcpu[cnt]) _orig_vcpu[cnt]->vcpu()->print_state(); } - //enter_kdebug("checksum"); + ERROR() << "Instances: " << _num_instances << " this inst " << idx; + enter_kdebug("checksum"); #endif return false; } @@ -131,6 +134,7 @@ class RecoverAbort static __attribute__((noreturn)) void recover() { ERROR() << "Aborting after error."; + Romain::_the_instance_manager->logdump(); enter_kdebug("abort"); throw("ERROR -> abort"); } diff --git a/l4/pkg/plr/server/src/thread_group.h b/l4/pkg/plr/server/src/thread_group.h index 056659ab3..8c6397df7 100644 --- a/l4/pkg/plr/server/src/thread_group.h +++ b/l4/pkg/plr/server/src/thread_group.h @@ -5,7 +5,7 @@ * * Thread group -> representation of a single replicated thread * - * (c) 2012 Björn Döbel , + * (c) 2012-2013 Björn Döbel , * economic rights: Technische Universität Dresden (Germany) * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. @@ -99,8 +99,10 @@ struct GateAgent #if USE_IRQ gate_irq->trigger(); l4_umword_t lbl; - l4_msgtag_t tag = l4_ipc_wait(l4_utcb(), &lbl, L4_IPC_NEVER); - /* XXX IPC error check */ + l4_ipc_wait(l4_utcb(), &lbl, L4_IPC_NEVER); + /* No error check. After return from this call, the UTCB contains + * the IPC error the gate agent received, which may in fact be a real + * IPC error -> it is up to the app to check and react on it. */ #endif DEBUG() << "agent returned."; @@ -108,7 +110,7 @@ struct GateAgent GateAgent(unsigned cap_idx, Romain::Thread_group *tg) - : current_client(0), owner_group(tg) + : owner_group(tg), current_client(0) { DEBUG() << "\033[31;1mGateAgent\033[0m"; sem_init(&init_sem, 0, 0); diff --git a/l4/pkg/plr/tools/boris/boris b/l4/pkg/plr/tools/boris/boris index 320609028..2eb3dd527 100755 --- a/l4/pkg/plr/tools/boris/boris +++ b/l4/pkg/plr/tools/boris/boris @@ -5,6 +5,13 @@ # Tool for parsing binaries and finding the relevant instrumentation # points for a fault injection campaign (which is then coordinated by # IGOR). +# +# (c) 2011-2013 Björn Döbel , +# economic rights: Technische Universität Dresden (Germany) +# +# This file is part of TUD:OS and distributed under the terms of the +# GNU General Public License 2. +# Please see the COPYING-GPL-2 file for details. import sys, os import udis86 diff --git a/l4/pkg/plr/tools/igor/igor b/l4/pkg/plr/tools/igor/igor index 031deef04..1229b8c7d 100755 --- a/l4/pkg/plr/tools/igor/igor +++ b/l4/pkg/plr/tools/igor/igor @@ -4,6 +4,13 @@ # # Tool for generating scripts running fault injection experiments # based on Romain running in QEMU +# +# (c) 2011-2013 Björn Döbel , +# economic rights: Technische Universität Dresden (Germany) +# +# This file is part of TUD:OS and distributed under the terms of the +# GNU General Public License 2. +# Please see the COPYING-GPL-2 file for details. import time import os,sys diff --git a/l4/pkg/plr/tools/timur/timur b/l4/pkg/plr/tools/timur/timur index a9041204f..86d3bd549 100755 --- a/l4/pkg/plr/tools/timur/timur +++ b/l4/pkg/plr/tools/timur/timur @@ -1,6 +1,13 @@ #!/usr/bin/python # Timur (*T*est*I*ng *M*achinari*U*m for *R*omain) +# +# (c) 2011-2013 Björn Döbel , +# economic rights: Technische Universität Dresden (Germany) +# +# This file is part of TUD:OS and distributed under the terms of the +# GNU General Public License 2. +# Please see the COPYING-GPL-2 file for details. import os, sys, sre import subprocess # launching qemu diff --git a/l4/pkg/plr/tools/tsar/tsar b/l4/pkg/plr/tools/tsar/tsar new file mode 100755 index 000000000..91a82f3ea --- /dev/null +++ b/l4/pkg/plr/tools/tsar/tsar @@ -0,0 +1,267 @@ +#!/usr/bin/python +# -*- coding: iso-8859-1 -*- +#vi: ft=python +# +# TSAR - Trace Sequence AnalyzeR +# * * * * +# Tool to extract and analyze Romain event logs +# +# (c) 2012-2013 Björn Döbel , +# economic rights: Technische Universität Dresden (Germany) +# +# This file is part of TUD:OS and distributed under the terms of the +# GNU General Public License 2. +# Please see the COPYING-GPL-2 file for details. + +import gzip +import operator +import os +import re +import sys +import struct +import tempfile +import uu + +import tsar_events + + +class EventFactory: + """Event factory: random access to Event objects + based on an underlying trace reader.""" + + def __init__(self, traceReader): + self.input = traceReader.raw_read() + self.offset = 0 + self.idpfx = traceReader.prefix() + + def uid(self, utcb): + return "%s:%x" % (self.idpfx, utcb) + + def reset(self): + self.offset = 0 + + def _build(self, start): + """Get the Event object in the input stream + at the given position""" + + if start >= len(self.input): + return None + + eventTypes = [ + None, + tsar_events.SyscallEvent, + tsar_events.PagefaultEvent, + tsar_events.SwifiEvent, + tsar_events.FooEvent, + tsar_events.TrapEvent, + tsar_events.ThreadStartEvent, + tsar_events.ThreadStopEvent, + ] + + #print "Input: %d bytes" % len(bytes) + + (tsc, utcb, typ) = struct.unpack_from("QIB", self.input[start:]) + + try: + return eventTypes[typ](self.input[start:], tsc, utcb, + self.uid(utcb)) + except IndexError: + print "Index error with event type %d" % typ + sys.exit(1) + + def nextEvent(self): + """Get the next event in stream + + Allows iterating over the stream.""" + start = self.offset * tsar_events.Event.EVENTSIZE + self.offset += 1 + return self._build(start) + + def eventAtOffset(self, offset): + """Get event at a specified offset. + + Random access to the stream.""" + start = offset * tsar_events.Event.EVENTSIZE + return self._build(start) + + +class TraceReader: + """Reader for zipped uu-encoded data""" + + def __init__(self, logfile): + tmp = tempfile.NamedTemporaryFile(mode="w+b") + # XXX also print UID here + print "UUDecoding %s -> %s" % (logfile.name, tmp.name) + uu.decode(logfile.name, tmp.name) + self.zipFile = gzip.open(tmp.name) + + self.pfx = os.path.splitext(os.path.basename(logfile.name))[0] + + def prefix(self): + return self.pfx + + def raw_read(self): + """Read the raw bytes from the underlying stream + into a string.""" + decomp = "" + bytes = self.zipFile.read(1024) + while bytes != "": + decomp += bytes + bytes = self.zipFile.read(1024) + print "Read %d bytes." % len(decomp) + + return decomp + + +class EventList: + """ + Raw list of events from potentially multiple event stream sources + """ + def __init__(self): + self.streams = [] + self.stream_index = 0 + + def addStream(self, eventFactory): + """Add another stream to the event sources""" + self.streams += [eventFactory] + + def reset(self): + """Reset the event list""" + for s in self.streams: + s.reset() + self.stream_index = 0 + + def next(self): + """Return the next event. + + Continuously calling this function iterates over the associated + streams one at a time. Returns 'None' if no more events are to + be found + """ + + if self.stream_index >= len(self.streams): + return None + + ev = self.streams[self.stream_index].nextEvent() + + if ev is None: + self.stream_index += 1 + return self.next() + + return ev + + +def print_plain(events): + """Plain dump of an event list""" + for e in events: + print e + + +def print_pretty(events): + """Pretty-printed event list. + + Prints a table. First column is a time stamp. Every other + colunm represents one distinct replica + """ + ids = [] + + # first run to determine UTCB IDs + for e in events: + if e.uid() not in ids: + ids += [e.uid()] + ids.sort() + + # header + print "\033[32m%14s" % "Timestamp", + for i in ids: + print "| %20s" % ("UID %s" % i[0:16]), + print "\033[0m" + + # printing run + for e in events: + first = True + for line in e.pretty(): + if first: + print "%14s" % e.ts, + first = False + else: + print " " * 14, + + idx = ids.index(e.uid()) + + for i in range(0, idx): + print "|", + print " " * 20, + if e.type == tsar_events.Event.TRAP_TYPE and e.is_start: + print "| \033[33m%20s\033[0m" % line, + else: + print "| %20s" % line, + for i in range(idx + 1, len(ids)): + print "|", + print " " * 20, + print + + +def remove_vt100(line): + """Remoe any occurrence of a VT100 color sequence from a string""" + return re.sub("\033\[\d+(;\d+)?m", "", line) + + +def extractLogs(inputFile): + """Take a QEMU log file (Fiasco serial output) and extract the + UU-encoded trace dumps from it. + """ + files = [] # list of trace files + inLogFile = False # are we currently operating on a dump? + + for l in file(inputFile).readlines(): + v = remove_vt100(l) + + # start and end indicators + startmo = re.match("romain.*(begin 644 .*.gz)", v) + endmo = re.match("romain.*end", v) + + if startmo: + curFile = tempfile.NamedTemporaryFile(mode="w+") + inLogFile = True + + # Write lines belonging to the dump to temporary file. + # Remove L4Re's log prefix upfront + if inLogFile: + curFile.write(v.replace("romain | ", "")) + + if inLogFile and endmo: + files += [curFile] + inLogFile = False + + return files + + +def main(): + if len(sys.argv) < 2: + print "Need at least 1 argument" + sys.exit(1) + + elist = EventList() + + for f in extractLogs(sys.argv[1]): + print "=== %s ===" % f.name + f.seek(0) # need to reset file seek ptr + elist.addStream(EventFactory(TraceReader(f))) + + events = [] + + e = elist.next() + while e is not None: + events += [e] + e = elist.next() + + # events are not necessarily sorted by time right now! + events.sort(key=operator.attrgetter('ts')) + + #print_plain(events) + print_pretty(events) + + +if __name__ == "__main__": + main() diff --git a/l4/pkg/plr/tools/tsar/tsar_events.py b/l4/pkg/plr/tools/tsar/tsar_events.py new file mode 100644 index 000000000..b1516a17e --- /dev/null +++ b/l4/pkg/plr/tools/tsar/tsar_events.py @@ -0,0 +1,162 @@ +#!/usr/bin/python + +import struct + +class Event: + """Event base class""" + + HEADSIZE = 13 + EVENTSIZE = 32 + + SYSCALL_TYPE = 1 + PAGEFAULT_TYPE = 2 + SWIFI_TYPE = 3 + FOO_TYPE = 4 + TRAP_TYPE = 5 + THREAD_START_TYPE = 6 + THREAD_STOP_TYPE = 7 + + @staticmethod + def eventName(ev): + """Get name for event type""" + syscall_names = ["INV", "SYS", "PF", + "SWIFI", "FOO", "TRAP", + "START", "STOP"] + return syscall_names[ev] + + def __init__(self, time=0, typ=0, utcb=0, uid=None): + self.ts = time + self.type = typ + self.utcb = utcb + if uid is None: + self.id = self.utcb + else: + self.id = uid + + def uid(self): + return self.id + + def __repr__(self): + return "%d [%8x|%5s]" % (self.ts, self.utcb, + Event.eventName(self.type)) + + +class SyscallEvent(Event): + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.SYSCALL_TYPE, utcb, uid) + (self.ip, self.label, ) = struct.unpack_from("II", + raw[Event.HEADSIZE:]) + + def __repr__(self): + return Event.__repr__(self) + " SYSCALL %08x, ret to %08x" % \ + (self.label, self.ip) + + def pretty(self, cols=20): + return ["SYSCALL %08x" % (self.label), + " ret -> %08x" % (self.ip)] + + +class PagefaultEvent(Event): + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.PAGEFAULT_TYPE, utcb, uid) + (self.writepf, ) = struct.unpack_from("B", raw[Event.HEADSIZE:]) + (self.pfa, + self.local, + self.remote) = struct.unpack_from("III", raw[Event.HEADSIZE + 1:]) + #print hex(self.pfa) + + def __repr__(self): + r = Event.__repr__(self) + if (self.writepf): + r += " w" + r += "r pf @ %08x -> %08x" % (self.local, self.remote) + return r + + def pretty(self, cols=20): + r = [] + if self.writepf: + r += ["wr pf @ 0x%x" % self.pfa] + else: + r += ["r pf @ 0x%x" % self.pfa] + r += ["%x -> %x" % (self.local, self.remote)] + return r + + +class SwifiEvent(Event): + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.SWIFI_TYPE, utcb, uid) + + def pretty(self, cols=20): + return ["SWIFI"] + + +class FooEvent(Event): + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.FOO_TYPE, utcb, uid) + (self.is_start, ) = struct.unpack_from("I", raw[Event.HEADSIZE:]) + + def __repr__(self): + r = Event.__repr__(self) + if self.is_start == 0: + r += " STOP" + else: + r += " START" + return r + + def pretty(self, cols=20): + return ["FOO"] + + +class TrapEvent(Event): + + counters = {} + + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.TRAP_TYPE, utcb, uid) + (self.is_start, ) = struct.unpack_from("B", raw[Event.HEADSIZE:]) + (self.trapaddr, self.trapno, ) = \ + struct.unpack_from("II", raw[Event.HEADSIZE + 1:]) + + #print "S %d T %d" % (self.is_start, self.trapno) + + def __repr__(self): + r = Event.__repr__(self) + if self.is_start == 1: + r += " start, trapno %x" % self.trapno + else: + r += " done" + return r + + def pretty(self, cols=20): + if self.is_start: + return ["TRAP %x @ %08x" % (self.trapno, self.trapaddr)] + else: + return ["--- TRAP END ---"] + + +class ThreadStartEvent(Event): + + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.THREAD_START_TYPE, utcb, uid) + + def __repr__(self): + r = Event.__repr__(self) + r += "Thread::Start" + return r + + def pretty(self, cols=20): + return ["Thread::Start"] + + +class ThreadStopEvent(Event): + + def __init__(self, raw, time=0, utcb=0, uid=None): + Event.__init__(self, time, Event.THREAD_STOP_TYPE, utcb, uid) + + def __repr__(self): + r = Event.__repr__(self) + r += "Thread::Exit" + return r + + def pretty(self, cols=20): + return ["Thread::Exit"] diff --git a/l4/pkg/serial-drv/server/src/main.cc b/l4/pkg/serial-drv/server/src/main.cc index 1cdcb1963..f501ec17e 100644 --- a/l4/pkg/serial-drv/server/src/main.cc +++ b/l4/pkg/serial-drv/server/src/main.cc @@ -147,7 +147,7 @@ Serial_drv::init() printf("serial-drv: virtual base at:%lx\n", virt_base); L4::Io_register_block_mmio *regs = new L4::Io_register_block_mmio(virt_base); - _uart = new (malloc(sizeof(L4::Uart_pl011))) L4::Uart_pl011; + _uart = new (malloc(sizeof(L4::Uart_pl011))) L4::Uart_pl011(24019200); //_uart = new (malloc(sizeof(L4::Uart_omap35x))) L4::Uart_omap35x; _uart->startup(regs); diff --git a/l4/pkg/sqlite/lib/README b/l4/pkg/sqlite/lib/README index f3ce39305..d6aee51d8 100644 --- a/l4/pkg/sqlite/lib/README +++ b/l4/pkg/sqlite/lib/README @@ -1,4 +1,7 @@ -The contrib directory contains the unmodified contents of -sqlite-autoconf-3071401.tar.gz +The contrib directory contains the nearly unmodified contents of +sqlite-autoconf-3071500.tar.gz + +The current change is to undef HAVE_POSIX_FALLOCATE in case of uclibc +because uclibc does not have it. diff --git a/l4/pkg/sqlite/lib/contrib/Makefile.am b/l4/pkg/sqlite/lib/contrib/Makefile.am index 3931d834b..6fc4f33c0 100644 --- a/l4/pkg/sqlite/lib/contrib/Makefile.am +++ b/l4/pkg/sqlite/lib/contrib/Makefile.am @@ -12,7 +12,7 @@ sqlite3_DEPENDENCIES = $(top_builddir)/libsqlite3.la include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.pc sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc diff --git a/l4/pkg/sqlite/lib/contrib/Makefile.in b/l4/pkg/sqlite/lib/contrib/Makefile.in index d4f1386f3..e74bc0138 100644 --- a/l4/pkg/sqlite/lib/contrib/Makefile.in +++ b/l4/pkg/sqlite/lib/contrib/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,12 +17,15 @@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -38,73 +40,56 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = sqlite3$(EXEEXT) -subdir = . DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/sqlite3.pc.in $(top_srcdir)/configure INSTALL \ config.guess config.sub depcomp install-sh ltmain.sh missing +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno + configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = sqlite3.pc -CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libsqlite3_la_LIBADD = am_libsqlite3_la_OBJECTS = sqlite3.lo libsqlite3_la_OBJECTS = $(am_libsqlite3_la_OBJECTS) -libsqlite3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libsqlite3_la_LDFLAGS) $(LDFLAGS) -o $@ +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_sqlite3_OBJECTS = shell.$(OBJEXT) sqlite3_OBJECTS = $(am_sqlite3_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ +DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) DIST_SOURCES = $(libsqlite3_la_SOURCES) $(sqlite3_SOURCES) man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) +pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) +includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags @@ -112,14 +97,16 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -132,62 +119,57 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ +ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -FGREP = @FGREP@ +F77 = @F77@ +FFLAGS = @FFLAGS@ GREP = @GREP@ -INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ -SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,7 +181,6 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ -builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -218,7 +199,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -228,12 +208,8 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c @@ -242,7 +218,7 @@ sqlite3_SOURCES = shell.c sqlite3.h sqlite3_LDADD = $(top_builddir)/libsqlite3.la @READLINE_LIBS@ sqlite3_DEPENDENCIES = $(top_builddir)/libsqlite3.la include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.pc sqlite3.1 tea +EXTRA_DIST = sqlite3.1 tea pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 @@ -256,15 +232,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -280,33 +256,28 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) + cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) sqlite3.pc: $(top_builddir)/config.status $(srcdir)/sqlite3.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ + test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ - list2="$$list2 $$p"; \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } + done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: @@ -318,53 +289,38 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libsqlite3.la: $(libsqlite3_la_OBJECTS) $(libsqlite3_la_DEPENDENCIES) - $(libsqlite3_la_LINK) -rpath $(libdir) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) + $(LINK) -rpath $(libdir) $(libsqlite3_la_LDFLAGS) $(libsqlite3_la_OBJECTS) $(libsqlite3_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done sqlite3$(EXEEXT): $(sqlite3_OBJECTS) $(sqlite3_DEPENDENCIES) @rm -f sqlite3$(EXEEXT) - $(LINK) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) + $(LINK) $(sqlite3_LDFLAGS) $(sqlite3_OBJECTS) $(sqlite3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -376,22 +332,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sqlite3.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -403,190 +359,171 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool config.lt -install-man1: $(man_MANS) + -rm -f libtool +uninstall-info-am: +install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done uninstall-man1: @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - test -z "$$files" || { \ - echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - for p in $$list; do \ + test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - for p in $$list; do \ + test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + f=$(am__strip_dir) \ + echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files + @list='$(include_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ + rm -f "$(DESTDIR)$(includedir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - set x; \ + tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique + $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ + mkdir $(distdir) + $(mkdir_p) $(distdir)/. + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -595,14 +532,6 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -626,17 +555,13 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -644,11 +569,9 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ + && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -670,15 +593,13 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ + @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -702,7 +623,7 @@ install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -724,7 +645,6 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -747,8 +667,6 @@ dvi-am: html: html-am -html-am: - info: info-am info-am: @@ -756,30 +674,12 @@ info-am: install-data-am: install-includeHEADERS install-man \ install-pkgconfigDATA -install-dvi: install-dvi-am - -install-dvi-am: - install-exec-am: install-binPROGRAMS install-libLTLIBRARIES -install-html: install-html-am - -install-html-am: - install-info: install-info-am -install-info-am: - install-man: install-man1 -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - installcheck-am: maintainer-clean: maintainer-clean-am @@ -803,34 +703,30 @@ ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-man uninstall-pkgconfigDATA + uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \ + uninstall-pkgconfigDATA uninstall-man: uninstall-man1 -.MAKE: install-am install-strip - .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-man1 install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-includeHEADERS \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-exec \ + install-exec-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-man1 install-pkgconfigDATA install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-includeHEADERS uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ uninstall-pkgconfigDATA - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/l4/pkg/sqlite/lib/contrib/configure b/l4/pkg/sqlite/lib/contrib/configure index 8a0568572..9bf7979ec 100755 --- a/l4/pkg/sqlite/lib/contrib/configure +++ b/l4/pkg/sqlite/lib/contrib/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for sqlite 3.7.14.1. +# Generated by GNU Autoconf 2.68 for sqlite 3.7.15. # # Report bugs to . # @@ -714,8 +714,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.7.14.1' -PACKAGE_STRING='sqlite 3.7.14.1' +PACKAGE_VERSION='3.7.15' +PACKAGE_STRING='sqlite 3.7.15' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1437,7 +1437,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.7.14.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.7.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1507,7 +1507,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.7.14.1:";; + short | recursive ) echo "Configuration of sqlite 3.7.15:";; esac cat <<\_ACEOF @@ -1617,7 +1617,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.7.14.1 +sqlite configure 3.7.15 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2237,7 +2237,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.7.14.1, which was +It was created by sqlite $as_me 3.7.15, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2906,7 +2906,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.7.14.1' + VERSION='3.7.15' cat >>confdefs.h <<_ACEOF @@ -20487,7 +20487,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.7.14.1, which was +This file was extended by sqlite $as_me 3.7.15, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20544,7 +20544,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.7.14.1 +sqlite config.status 3.7.15 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/l4/pkg/sqlite/lib/contrib/configure.ac b/l4/pkg/sqlite/lib/contrib/configure.ac index 36c1aed16..657d496e1 100644 --- a/l4/pkg/sqlite/lib/contrib/configure.ac +++ b/l4/pkg/sqlite/lib/contrib/configure.ac @@ -8,7 +8,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.7.14.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.7.15, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) # Use automake. diff --git a/l4/pkg/sqlite/lib/contrib/shell.c b/l4/pkg/sqlite/lib/contrib/shell.c index a17d96624..7dd741b2d 100644 --- a/l4/pkg/sqlite/lib/contrib/shell.c +++ b/l4/pkg/sqlite/lib/contrib/shell.c @@ -541,6 +541,9 @@ static void output_c_string(FILE *out, const char *z){ if( c=='\\' ){ fputc(c, out); fputc(c, out); + }else if( c=='"' ){ + fputc('\\', out); + fputc('"', out); }else if( c=='\t' ){ fputc('\\', out); fputc('t', out); @@ -696,7 +699,7 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int }else{ w = 0; } - if( w<=0 ){ + if( w==0 ){ w = strlen30(azCol[i] ? azCol[i] : ""); if( w<10 ) w = 10; n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue); @@ -706,7 +709,11 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int p->actualWidth[i] = w; } if( p->showHeader ){ - fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); + if( w<0 ){ + fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], i==nArg-1 ? "\n": " "); + }else{ + fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); + } } } if( p->showHeader ){ @@ -714,6 +721,7 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int int w; if( iactualWidth) ){ w = p->actualWidth[i]; + if( w<0 ) w = -w; }else{ w = 10; } @@ -735,8 +743,13 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int strlen30(azArg[i])>w ){ w = strlen30(azArg[i]); } - fprintf(p->out,"%-*.*s%s",w,w, - azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); + if( w<0 ){ + fprintf(p->out,"%*.*s%s",-w,-w, + azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); + }else{ + fprintf(p->out,"%-*.*s%s",w,w, + azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); + } } break; } @@ -786,14 +799,14 @@ static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int if( p->cnt++==0 && p->showHeader ){ for(i=0; iout,azCol[i] ? azCol[i] : ""); - fprintf(p->out, "%s", p->separator); + if(iout, "%s", p->separator); } fprintf(p->out,"\n"); } if( azArg==0 ) break; for(i=0; iout, azArg[i] ? azArg[i] : p->nullvalue); - fprintf(p->out, "%s", p->separator); + if(iout, "%s", p->separator); } fprintf(p->out,"\n"); break; @@ -1416,9 +1429,10 @@ static char zHelp[] = " list Values delimited by .separator string\n" " tabs Tab-separated values\n" " tcl TCL list elements\n" - ".nullvalue STRING Print STRING in place of NULL values\n" + ".nullvalue STRING Use STRING in place of NULL values\n" ".output FILENAME Send output to FILENAME\n" ".output stdout Send output to the screen\n" + ".print STRING... Print literal STRING\n" ".prompt MAIN CONTINUE Replace the standard prompts\n" ".quit Exit this program\n" ".read FILENAME Execute SQL in FILENAME\n" @@ -2007,6 +2021,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ p->mode = MODE_Html; }else if( n2==3 && strncmp(azArg[1],"tcl",n2)==0 ){ p->mode = MODE_Tcl; + sqlite3_snprintf(sizeof(p->separator), p->separator, " "); }else if( n2==3 && strncmp(azArg[1],"csv",n2)==0 ){ p->mode = MODE_Csv; sqlite3_snprintf(sizeof(p->separator), p->separator, ","); @@ -2070,6 +2085,15 @@ static int do_meta_command(char *zLine, struct callback_data *p){ } }else + if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ + int i; + for(i=1; i1 ) fprintf(p->out, " "); + fprintf(p->out, "%s", azArg[i]); + } + fprintf(p->out, "\n"); + }else + if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){ if( nArg >= 2) { strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1); @@ -2493,6 +2517,13 @@ static int do_meta_command(char *zLine, struct callback_data *p){ } }else +#if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE) + if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){ + extern int sqlite3WhereTrace; + sqlite3WhereTrace = atoi(azArg[1]); + }else +#endif + if( c=='w' && strncmp(azArg[0], "width", n)==0 && nArg>1 ){ int j; assert( nArg<=ArraySize(azArg) ); @@ -2684,7 +2715,7 @@ static int process_input(struct callback_data *p, FILE *in){ free(zSql); } free(zLine); - return errCnt; + return errCnt>0; } /* @@ -2797,11 +2828,14 @@ static const char zOptions[] = " -bail stop after hitting an error\n" " -batch force batch I/O\n" " -column set output mode to 'column'\n" - " -cmd command run \"command\" before reading stdin\n" + " -cmd COMMAND run \"COMMAND\" before reading stdin\n" " -csv set output mode to 'csv'\n" " -echo print commands before execution\n" - " -init filename read/process named file\n" + " -init FILENAME read/process named file\n" " -[no]header turn headers on or off\n" +#if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) + " -heap SIZE Size of heap for memsys3 or memsys5\n" +#endif " -help show this message\n" " -html set output mode to HTML\n" " -interactive force interactive I/O\n" @@ -2810,8 +2844,8 @@ static const char zOptions[] = #ifdef SQLITE_ENABLE_MULTIPLEX " -multiplex enable the multiplexor VFS\n" #endif - " -nullvalue 'text' set text string for NULL values\n" - " -separator 'x' set output field separator (|)\n" + " -nullvalue TEXT set text string for NULL values. Default ''\n" + " -separator SEP set output field separator. Default: '|'\n" " -stats print memory stats before each finalize\n" " -version show SQLite version\n" " -vfs NAME use NAME as the default VFS\n" @@ -2847,6 +2881,19 @@ static void main_init(struct callback_data *data) { sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); } +/* +** Get the argument to an --option. Throw an error and die if no argument +** is available. +*/ +static char *cmdline_option_value(int argc, char **argv, int i){ + if( i==argc ){ + fprintf(stderr, "%s: Error: missing argument to %s\n", + argv[0], argv[argc-1]); + exit(1); + } + return argv[i]; +} + int main(int argc, char **argv){ char *zErrMsg = 0; struct callback_data data; @@ -2876,24 +2923,35 @@ int main(int argc, char **argv){ ** the size of the alternative malloc heap, ** and the first command to execute. */ - for(i=1; i=argc){ - fprintf(stderr,"%s: Error: missing argument for option: %s\n", - Argv0, z); - fprintf(stderr,"Use -help for a list of options.\n"); - return 1; - } sqlite3_snprintf(sizeof(data.separator), data.separator, - "%.*s",(int)sizeof(data.separator)-1,argv[i]); + "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-nullvalue")==0 ){ - i++; - if(i>=argc){ - fprintf(stderr,"%s: Error: missing argument for option: %s\n", - Argv0, z); - fprintf(stderr,"Use -help for a list of options.\n"); - return 1; - } sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, - "%.*s",(int)sizeof(data.nullvalue)-1,argv[i]); + "%s",cmdline_option_value(argc,argv,++i)); }else if( strcmp(z,"-header")==0 ){ data.showHeader = 1; }else if( strcmp(z,"-noheader")==0 ){ @@ -3055,8 +3084,7 @@ int main(int argc, char **argv){ usage(1); }else if( strcmp(z,"-cmd")==0 ){ if( i==argc-1 ) break; - i++; - z = argv[i]; + z = cmdline_option_value(argc,argv,++i); if( z[0]=='.' ){ rc = do_meta_command(z, &data); if( rc && bail_on_error ) return rc; diff --git a/l4/pkg/sqlite/lib/contrib/sqlite3.c b/l4/pkg/sqlite/lib/contrib/sqlite3.c index 55039b963..f7dabc6c7 100644 --- a/l4/pkg/sqlite/lib/contrib/sqlite3.c +++ b/l4/pkg/sqlite/lib/contrib/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.7.14.1. By combining all the individual C code files into this +** version 3.7.15. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -673,9 +673,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.7.14.1" -#define SQLITE_VERSION_NUMBER 3007014 -#define SQLITE_SOURCE_ID "2012-10-04 19:37:12 091570e46d04e84b67228e0bdbcd6e1fb60c6bdb" +#define SQLITE_VERSION "3.7.15" +#define SQLITE_VERSION_NUMBER 3007015 +#define SQLITE_SOURCE_ID "2012-12-12 13:36:53 cd0b37c52658bfdf992b1e3dc467bae1835a94ae" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1040,10 +1040,12 @@ SQLITE_API int sqlite3_exec( #define SQLITE_IOERR_SHMLOCK (SQLITE_IOERR | (20<<8)) #define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) +#define SQLITE_IOERR_DELETE_NOENT (SQLITE_IOERR | (23<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) #define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) +#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) @@ -1421,6 +1423,26 @@ struct sqlite3_io_methods { ** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] ** file control occurs at the beginning of pragma statement analysis and so ** it is able to override built-in [PRAGMA] statements. +** +**
  • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^This file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connections busy-handler callback. The argument is of type (void **) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connections +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
  • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Application can invoke this file-control to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1437,6 +1459,8 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_VFSNAME 12 #define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 #define SQLITE_FCNTL_PRAGMA 14 +#define SQLITE_FCNTL_BUSYHANDLER 15 +#define SQLITE_FCNTL_TEMPFILENAME 16 /* ** CAPI3REF: Mutex Handle @@ -2133,11 +2157,39 @@ struct sqlite3_mem_methods { ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** +** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]]
    SQLITE_CONFIG_COVERING_INDEX_SCAN +**
    This option takes a single integer argument which is interpreted as +** a boolean in order to enable or disable the use of covering indices for +** full table scans in the query optimizer. The default setting is determined +** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on" +** if that compile-time option is omitted. +** The ability to disable the use of covering indices for full table scans +** is because some incorrectly coded legacy applications might malfunction +** malfunction when the optimization is enabled. Providing the ability to +** disable the optimization allows the older, buggy application code to work +** without change even with newer versions of SQLite. +** ** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] **
    SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE **
    These options are obsolete and should not be used by new code. ** They are retained for backwards compatibility but are now no-ops. ** +** +** [[SQLITE_CONFIG_SQLLOG]] +**
    SQLITE_CONFIG_SQLLOG +**
    This option is only available if sqlite is compiled with the +** SQLITE_ENABLE_SQLLOG pre-processor macro defined. The first argument should +** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). +** The second should be of type (void*). The callback is invoked by the library +** in three separate circumstances, identified by the value passed as the +** fourth parameter. If the fourth parameter is 0, then the database connection +** passed as the second argument has just been opened. The third argument +** points to a buffer containing the name of the main database file. If the +** fourth parameter is 1, then the SQL statement that the third parameter +** points to has just been executed. Or, if the fourth parameter is 2, then +** the connection being passed as the second parameter is being closed. The +** third parameter is passed NULL In this case. +** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ @@ -2158,6 +2210,8 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_URI 17 /* int */ #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ +#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ +#define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ /* ** CAPI3REF: Database Connection Configuration Options @@ -3166,7 +3220,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** an error)^. ** ^If "ro" is specified, then the database is opened for read-only ** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the -** third argument to sqlite3_prepare_v2(). ^If the mode option is set to +** third argument to sqlite3_open_v2(). ^If the mode option is set to ** "rw", then the database is opened for read-write (but not create) ** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had ** been set. ^Value "rwc" is equivalent to setting both @@ -3318,6 +3372,11 @@ SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int ** However, the error string might be overwritten or deallocated by ** subsequent calls to other SQLite interface functions.)^ ** +** ^The sqlite3_errstr() interface returns the English-language text +** that describes the [result code], as UTF-8. +** ^(Memory to hold the error message string is managed internally +** and must not be freed by the application)^. +** ** When the serialized [threading mode] is in use, it might be the ** case that a second error occurs on a separate thread in between ** the time of the first error and the call to these interfaces. @@ -3336,6 +3395,7 @@ SQLITE_API int sqlite3_errcode(sqlite3 *db); SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); SQLITE_API const char *sqlite3_errmsg(sqlite3*); SQLITE_API const void *sqlite3_errmsg16(sqlite3*); +SQLITE_API const char *sqlite3_errstr(int); /* ** CAPI3REF: SQL Statement Object @@ -5298,6 +5358,9 @@ SQLITE_API void *sqlite3_update_hook( ** future releases of SQLite. Applications that care about shared ** cache setting should set it explicitly. ** +** This interface is threadsafe on processors where writing a +** 32-bit integer is atomic. +** ** See Also: [SQLite Shared-Cache Mode] */ SQLITE_API int sqlite3_enable_shared_cache(int); @@ -8263,6 +8326,7 @@ typedef struct Parse Parse; typedef struct RowSet RowSet; typedef struct Savepoint Savepoint; typedef struct Select Select; +typedef struct SelectDest SelectDest; typedef struct SrcList SrcList; typedef struct StrAccum StrAccum; typedef struct Table Table; @@ -8359,6 +8423,9 @@ SQLITE_PRIVATE int sqlite3BtreeMaxPageCount(Btree*,int); SQLITE_PRIVATE u32 sqlite3BtreeLastPage(Btree*); SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeGetReserve(Btree*); +#if defined(SQLITE_HAS_CODEC) || defined(SQLITE_DEBUG) +SQLITE_PRIVATE int sqlite3BtreeGetReserveNoMutex(Btree *p); +#endif SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *, int); SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int); @@ -8402,6 +8469,8 @@ SQLITE_PRIVATE void sqlite3BtreeTripAllCursors(Btree*, int); SQLITE_PRIVATE void sqlite3BtreeGetMeta(Btree *pBtree, int idx, u32 *pValue); SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value); +SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p); + /* ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta ** should be one of the following values. The integer values are assigned @@ -8869,7 +8938,7 @@ typedef struct VdbeOpList VdbeOpList; #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */ #define OPFLG_INITIALIZER {\ /* 0 */ 0x00, 0x01, 0x01, 0x04, 0x04, 0x10, 0x00, 0x02,\ -/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x24, 0x24,\ +/* 8 */ 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x24,\ /* 16 */ 0x00, 0x00, 0x00, 0x24, 0x04, 0x05, 0x04, 0x00,\ /* 24 */ 0x00, 0x01, 0x01, 0x05, 0x05, 0x00, 0x00, 0x00,\ /* 32 */ 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00,\ @@ -8916,7 +8985,7 @@ SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*); -SQLITE_PRIVATE void sqlite3VdbeDeleteObject(sqlite3*,Vdbe*); +SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3*,Vdbe*); SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,Parse*); SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*); SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int); @@ -9106,11 +9175,14 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int n); SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint); SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager); -SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, int, int*, int*); -SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); -SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); -SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); -SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); +#ifndef SQLITE_OMIT_WAL +SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, int, int*, int*); +SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); +SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); +SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); +#endif + #ifdef SQLITE_ENABLE_ZIPVFS SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager); #endif @@ -9128,6 +9200,7 @@ SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager*); SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager*); SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *); SQLITE_PRIVATE void sqlite3PagerClearCache(Pager *); +SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *); /* Functions used to truncate the database file. */ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager*,Pgno); @@ -9825,6 +9898,7 @@ struct sqlite3 { unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ + u16 dbOptFlags; /* Flags to enable/disable optimizations */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ u8 mallocFailed; /* True if we have seen a malloc failure */ @@ -9929,48 +10003,59 @@ struct sqlite3 { /* ** Possible values for the sqlite3.flags. */ -#define SQLITE_VdbeTrace 0x00000100 /* True to trace VDBE execution */ -#define SQLITE_InternChanges 0x00000200 /* Uncommitted Hash table changes */ -#define SQLITE_FullColNames 0x00000400 /* Show full column names on SELECT */ -#define SQLITE_ShortColNames 0x00000800 /* Show short columns names */ -#define SQLITE_CountRows 0x00001000 /* Count rows changed by INSERT, */ +#define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ +#define SQLITE_InternChanges 0x00000002 /* Uncommitted Hash table changes */ +#define SQLITE_FullColNames 0x00000004 /* Show full column names on SELECT */ +#define SQLITE_ShortColNames 0x00000008 /* Show short columns names */ +#define SQLITE_CountRows 0x00000010 /* Count rows changed by INSERT, */ /* DELETE, or UPDATE and return */ /* the count using a callback. */ -#define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ +#define SQLITE_NullCallback 0x00000020 /* Invoke the callback once if the */ /* result set is empty */ -#define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ -#define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ -#define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ - /* 0x00020000 Unused */ -#define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ -#define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ -#define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ -#define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ -#define SQLITE_CkptFullFSync 0x00400000 /* Use full fsync for checkpoint */ -#define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */ -#define SQLITE_ReverseOrder 0x01000000 /* Reverse unordered SELECTs */ -#define SQLITE_RecTriggers 0x02000000 /* Enable recursive triggers */ -#define SQLITE_ForeignKeys 0x04000000 /* Enforce foreign key constraints */ -#define SQLITE_AutoIndex 0x08000000 /* Enable automatic indexes */ -#define SQLITE_PreferBuiltin 0x10000000 /* Preference to built-in funcs */ -#define SQLITE_LoadExtension 0x20000000 /* Enable load_extension */ -#define SQLITE_EnableTrigger 0x40000000 /* True to enable triggers */ - -/* -** Bits of the sqlite3.flags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface. -** These must be the low-order bits of the flags field. -*/ -#define SQLITE_QueryFlattener 0x01 /* Disable query flattening */ -#define SQLITE_ColumnCache 0x02 /* Disable the column cache */ -#define SQLITE_IndexSort 0x04 /* Disable indexes for sorting */ -#define SQLITE_IndexSearch 0x08 /* Disable indexes for searching */ -#define SQLITE_IndexCover 0x10 /* Disable index covering table */ -#define SQLITE_GroupByOrder 0x20 /* Disable GROUPBY cover of ORDERBY */ -#define SQLITE_FactorOutConst 0x40 /* Disable factoring out constants */ -#define SQLITE_IdxRealAsInt 0x80 /* Store REAL as INT in indices */ -#define SQLITE_DistinctOpt 0x80 /* DISTINCT using indexes */ -#define SQLITE_OptMask 0xff /* Mask of all disablable opts */ +#define SQLITE_SqlTrace 0x00000040 /* Debug print SQL as it executes */ +#define SQLITE_VdbeListing 0x00000080 /* Debug listings of VDBE programs */ +#define SQLITE_WriteSchema 0x00000100 /* OK to update SQLITE_MASTER */ + /* 0x00000200 Unused */ +#define SQLITE_IgnoreChecks 0x00000400 /* Do not enforce check constraints */ +#define SQLITE_ReadUncommitted 0x0000800 /* For shared-cache mode */ +#define SQLITE_LegacyFileFmt 0x00001000 /* Create new databases in format 1 */ +#define SQLITE_FullFSync 0x00002000 /* Use full fsync on the backend */ +#define SQLITE_CkptFullFSync 0x00004000 /* Use full fsync for checkpoint */ +#define SQLITE_RecoveryMode 0x00008000 /* Ignore schema errors */ +#define SQLITE_ReverseOrder 0x00010000 /* Reverse unordered SELECTs */ +#define SQLITE_RecTriggers 0x00020000 /* Enable recursive triggers */ +#define SQLITE_ForeignKeys 0x00040000 /* Enforce foreign key constraints */ +#define SQLITE_AutoIndex 0x00080000 /* Enable automatic indexes */ +#define SQLITE_PreferBuiltin 0x00100000 /* Preference to built-in funcs */ +#define SQLITE_LoadExtension 0x00200000 /* Enable load_extension */ +#define SQLITE_EnableTrigger 0x00400000 /* True to enable triggers */ + +/* +** Bits of the sqlite3.dbOptFlags field that are used by the +** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to +** selectively disable various optimizations. +*/ +#define SQLITE_QueryFlattener 0x0001 /* Query flattening */ +#define SQLITE_ColumnCache 0x0002 /* Column cache */ +#define SQLITE_GroupByOrder 0x0004 /* GROUPBY cover of ORDERBY */ +#define SQLITE_FactorOutConst 0x0008 /* Constant factoring */ +#define SQLITE_IdxRealAsInt 0x0010 /* Store REAL as INT in indices */ +#define SQLITE_DistinctOpt 0x0020 /* DISTINCT using indexes */ +#define SQLITE_CoverIdxScan 0x0040 /* Covering index scans */ +#define SQLITE_OrderByIdxJoin 0x0080 /* ORDER BY of joins via index */ +#define SQLITE_SubqCoroutine 0x0100 /* Evaluate subqueries as coroutines */ +#define SQLITE_AllOpts 0xffff /* All optimizations */ + +/* +** Macros for testing whether or not optimizations are enabled or disabled. +*/ +#ifndef SQLITE_OMIT_BUILTIN_TEST +#define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0) +#define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0) +#else +#define OptimizationDisabled(db, mask) 0 +#define OptimizationEnabled(db, mask) 1 +#endif /* ** Possible values for the sqlite.magic field. @@ -10121,32 +10206,22 @@ struct Column { char *zDflt; /* Original text of the default value */ char *zType; /* Data type for this column */ char *zColl; /* Collating sequence. If NULL, use the default */ - u8 notNull; /* True if there is a NOT NULL constraint */ - u8 isPrimKey; /* True if this column is part of the PRIMARY KEY */ + u8 notNull; /* An OE_ code for handling a NOT NULL constraint */ char affinity; /* One of the SQLITE_AFF_... values */ -#ifndef SQLITE_OMIT_VIRTUALTABLE - u8 isHidden; /* True if this column is 'hidden' */ -#endif + u16 colFlags; /* Boolean properties. See COLFLAG_ defines below */ }; +/* Allowed values for Column.colFlags: +*/ +#define COLFLAG_PRIMKEY 0x0001 /* Column is part of the primary key */ +#define COLFLAG_HIDDEN 0x0002 /* A hidden column in a virtual table */ + /* ** A "Collating Sequence" is defined by an instance of the following ** structure. Conceptually, a collating sequence consists of a name and ** a comparison routine that defines the order of that sequence. ** -** There may two separate implementations of the collation function, one -** that processes text in UTF-8 encoding (CollSeq.xCmp) and another that -** processes text encoded in UTF-16 (CollSeq.xCmp16), using the machine -** native byte order. When a collation sequence is invoked, SQLite selects -** the version that will require the least expensive encoding -** translations, if any. -** -** The CollSeq.pUser member variable is an extra parameter that passed in -** as the first argument to the UTF-8 comparison function, xCmp. -** CollSeq.pUser16 is the equivalent for the UTF-16 comparison function, -** xCmp16. -** -** If both CollSeq.xCmp and CollSeq.xCmp16 are NULL, it means that the +** If CollSeq.xCmp is NULL, it means that the ** collating sequence is undefined. Indices built on an undefined ** collating sequence may not be read or written. */ @@ -10284,28 +10359,28 @@ struct VTable { */ struct Table { char *zName; /* Name of the table or view */ - int iPKey; /* If not negative, use aCol[iPKey] as the primary key */ - int nCol; /* Number of columns in this table */ Column *aCol; /* Information about each column */ Index *pIndex; /* List of SQL indexes on this table. */ - int tnum; /* Root BTree node for this table (see note above) */ - tRowcnt nRowEst; /* Estimated rows in table - from sqlite_stat1 table */ Select *pSelect; /* NULL for tables. Points to definition if a view. */ - u16 nRef; /* Number of pointers to this Table */ - u8 tabFlags; /* Mask of TF_* values */ - u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ FKey *pFKey; /* Linked list of all foreign keys in this table */ char *zColAff; /* String defining the affinity of each column */ #ifndef SQLITE_OMIT_CHECK ExprList *pCheck; /* All CHECK constraints */ #endif + tRowcnt nRowEst; /* Estimated rows in table - from sqlite_stat1 table */ + int tnum; /* Root BTree node for this table (see note above) */ + i16 iPKey; /* If not negative, use aCol[iPKey] as the primary key */ + i16 nCol; /* Number of columns in this table */ + u16 nRef; /* Number of pointers to this Table */ + u8 tabFlags; /* Mask of TF_* values */ + u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ #ifndef SQLITE_OMIT_ALTERTABLE int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE - VTable *pVTable; /* List of VTable objects. */ int nModuleArg; /* Number of arguments to the module */ char **azModuleArg; /* Text of all module args. [0] is module name */ + VTable *pVTable; /* List of VTable objects. */ #endif Trigger *pTrigger; /* List of triggers stored in pSchema */ Schema *pSchema; /* Schema that contains this table */ @@ -10329,7 +10404,7 @@ struct Table { */ #ifndef SQLITE_OMIT_VIRTUALTABLE # define IsVirtual(X) (((X)->tabFlags & TF_Virtual)!=0) -# define IsHiddenColumn(X) ((X)->isHidden) +# define IsHiddenColumn(X) (((X)->colFlags & COLFLAG_HIDDEN)!=0) #else # define IsVirtual(X) 0 # define IsHiddenColumn(X) 0 @@ -10674,13 +10749,15 @@ struct Expr { ExprList *pList; /* Function arguments or in " IN ( IN (