snprintf(s, len, "%c%c%c%c%c%c",
(state & Vcpu_state::F_fpu_enabled) ? 'F' : 'f',
(state & Vcpu_state::F_user_mode) ? 'U' : 'u',
- (state & Vcpu_state::F_exceptions) ? 'E' : 'e',
(state & Vcpu_state::F_debug_exc) ? 'D' : 'd',
+ (state & Vcpu_state::F_exceptions) ? 'E' : 'e',
(state & Vcpu_state::F_page_faults) ? 'P' : 'p',
(state & Vcpu_state::F_irqs) ? 'I' : 'i');
s[len - 1] = 0;
Trap_state::sanitize_user_state()
{
_cs = Gdt::gdt_code_user | Gdt::Selector_user;
+ _ss = Gdt::gdt_data_user | Gdt::Selector_user;
_flags = (_flags & ~(EFLAGS_IOPL | EFLAGS_NT)) | EFLAGS_IF;
}
*/
PUBLIC
Sched_context::Sched_context()
-: _prio(Config::boot_prio),
+: _ready_next(0),
+ _prio(Config::boot_prio),
_quantum(Config::default_time_slice),
_left(Config::default_time_slice)
{}
_sc.fp._p = Config::boot_prio;
_sc.fp._q = Config::default_time_slice;
_sc.fp._left = Config::default_time_slice;
+ _sc.fp._ready_next = 0;
}
IMPLEMENT inline
e = l:start({ caps = {
fb = mag_caps.svc:create(L4.Proto.Goos, "640x480"),
},
- log = { "png", "b" },
+ log = { "spectrum", "b" },
l4re_dbg = L4.Dbg.Warn,
-- scheduler = L4.Env.user_factory:create(L4.Proto.Scheduler, 0x18, 0x8),
},
e = l:start({ caps = {
fb = mag_caps.svc:create(L4.Proto.Goos, "640x480"),
},
- log = { "png", "b" },
+ log = { "spectrum", "b" },
l4re_dbg = L4.Dbg.Warn,
-- scheduler = L4.Env.user_factory:create(L4.Proto.Scheduler, 0x18, 0x8),
},
else
bootstrap: $(BOOTSTRAP_ELF_NAME)
$(VERBOSE)$(LN) -f $^ $@
+endif
bootstrap_$(ENTRY_FN): $(BOOTSTRAP_ELF_NAME)
$(VERBOSE)$(LN) -f $^ $@
-endif
void
Region::print() const
{
- printf(" [%9llx, %9llx]", begin(), end());
+ printf(" [%9llx, %9llx] {%9llx}", begin(), end(), end() - begin() + 1);
}
void
move_modules(l4util_mb_info_t *mbi, unsigned long modaddr)
{
long offset = modaddr - (L4_MB_MOD_PTR(mbi->mods_addr))[0].mod_start;
- unsigned i;
- unsigned dir = offset > 0 ? mbi->mods_count : 1;
+ unsigned i, i_end;
+ unsigned dir = offset > 0 ? -1 : 1;
if (!offset)
{
return;
}
- printf(" move modules to %lx with offset %lx\n", modaddr, offset);
+ printf(" Moving %d modules to %lx with offset %lx\n",
+ mbi->mods_count, modaddr, offset);
- for (i = dir; i != mbi->mods_count - dir ; offset > 0 ? i-- : i++)
+ i = dir == 1 ? 1 : mbi->mods_count;
+ i_end = dir == 1 ? mbi->mods_count + 1 : 0;
+ for (; i != i_end ; i += dir)
{
unsigned long start = (L4_MB_MOD_PTR(mbi->mods_addr))[i-1].mod_start;
unsigned long end = (L4_MB_MOD_PTR(mbi->mods_addr))[i-1].mod_end;
if (start == end)
- continue;
+ continue;
#ifdef VERBOSE_LOAD
unsigned char c[5];
c[1] = c[1] < 32 ? '.' : c[1];
c[2] = c[2] < 32 ? '.' : c[2];
c[3] = c[3] < 32 ? '.' : c[3];
- printf(" move module %02d { %lx, %lx } (%s) -> { %lx - %lx }\n",
+ printf(" moving module %02d { %lx, %lx } (%s) -> { %lx - %lx }\n",
i, start, end, c, start + offset, end + offset);
for (int a = 0; a < 0x100; a += 4)
printf("%08lx%s", *(unsigned long *)(start + a), (a % 32 == 28) ? "\n" : " ");
printf("\n");
#else
- printf(" move module %02d { %lx-%lx } -> { %lx-%lx }\n",
+ printf(" moving module %02d { %lx-%lx } -> { %lx-%lx }\n",
i, start, end, start + offset, end + offset);
#endif
#pragma once
-#if defined(L4RE_NO_COUNTING_CAP_ALLOC)
+//#define L4RE_STATIC_CAP_ALLOC
+#if defined(L4RE_STATIC_CAP_ALLOC)
#include <l4/re/util/bitmap_cap_alloc>
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*/
-#include <l4/re/util/cap_alloc>
-#include <l4/re/env>
+
#include <l4/crtn/initpriorities.h>
-#include <l4/re/dataspace>
-#include <l4/re/mem_alloc>
+#include <l4/re/env>
+#include <l4/re/util/cap_alloc>
+
+//#define L4RE_STATIC_CAP_ALLOC
+#if defined(L4RE_STATIC_CAP_ALLOC)
namespace
{
-#if defined(L4RE_NO_COUNTING_CAP_ALLOC)
-
L4Re::Util::Cap_alloc<4096> __attribute__((init_priority(INIT_PRIO_L4RE_UTIL_CAP_ALLOC))) __cap_alloc(L4Re::Env::env()->first_free_cap());
+};
#else
+#include <l4/re/dataspace>
+#include <l4/re/mem_alloc>
+
+namespace
+{
struct Ca : public L4Re::Util::_Cap_alloc
{
enum { Caps = 4096 };
};
Ca __attribute__((init_priority(INIT_PRIO_L4RE_UTIL_CAP_ALLOC))) __cap_alloc;
-#endif
};
+#endif
namespace L4Re { namespace Util {
typedef struct l4_vcpu_regs_t
{
#if 0
- l4_umword_t es; /**< gs register */
- l4_umword_t ds; /**< fs register */
+ l4_umword_t es; /**< es register */
+ l4_umword_t ds; /**< ds register */
l4_umword_t gs; /**< gs register */
l4_umword_t fs; /**< fs register */
#endif
- l4_umword_t r15; /**< edi register */
- l4_umword_t r14; /**< esi register */
- l4_umword_t r13; /**< ebp register */
- l4_umword_t r12; /**< page fault address */
- l4_umword_t r11; /**< edi register */
- l4_umword_t r10; /**< esi register */
- l4_umword_t r9; /**< ebp register */
- l4_umword_t r8; /**< page fault address */
+ l4_umword_t r15; /**< r15 register */
+ l4_umword_t r14; /**< r14 register */
+ l4_umword_t r13; /**< r13 register */
+ l4_umword_t r12; /**< r12 register */
+ l4_umword_t r11; /**< r11 register */
+ l4_umword_t r10; /**< r10 register */
+ l4_umword_t r9; /**< r9 register */
+ l4_umword_t r8; /**< r8 reigster */
- l4_umword_t di; /**< edi register */
- l4_umword_t si; /**< esi register */
- l4_umword_t bp; /**< ebp register */
+ l4_umword_t di; /**< rdi register */
+ l4_umword_t si; /**< rsi register */
+ l4_umword_t bp; /**< rbp register */
l4_umword_t pfa; /**< page fault address */
- l4_umword_t bx; /**< ebx register */
- l4_umword_t dx; /**< edx register */
- l4_umword_t cx; /**< ecx register */
- l4_umword_t ax; /**< eax register */
+ l4_umword_t bx; /**< rbx register */
+ l4_umword_t dx; /**< rdx register */
+ l4_umword_t cx; /**< rcx register */
+ l4_umword_t ax; /**< rax register */
l4_umword_t trapno; /**< trap number */
l4_umword_t err; /**< error code */
- l4_umword_t ip; /**< instruction pointer */
+ l4_umword_t ip; /**< instruction pointer */
l4_umword_t dummy1; /**< dummy \internal */
- l4_umword_t flags; /**< eflags */
- l4_umword_t sp; /**< stack pointer */
+ l4_umword_t flags; /**< eflags */
+ l4_umword_t sp; /**< stack pointer */
l4_umword_t ss;
} l4_vcpu_regs_t;
[L4_EAGAIN] = "Try again",
[L4_ENOMEM] = "Insufficient memory",
[L4_EACCESS] = "Access not permitted",
+ [L4_EBUSY] = "Function busy",
[L4_EEXIST] = "Object exists",
[L4_ENODEV] = "No such device",
[L4_EINVAL] = "Invalid argument",
* \file
* \brief time stamp counter related functions
*
- * \date Frank Mehnert <fm3@os.inf.tu-dresden.de>
+ * \author Frank Mehnert <fm3@os.inf.tu-dresden.de>
* \ingroup l4util_tsc
*/
* calibration using the PIT.
* \param kip KIP pointer
* \return 0 on error (no scalers exported by kernel, calibrating failed ...)
- * otherwise returns (2^32 / (tsc per µsec)). This value has the
+ * otherwise returns (2^32 / (tsc per µsec)). This value has the
* same semantics as the value returned by the calibrate_delay_loop()
* function of the Linux kernel.
*/
L4IO_MEM_USE_MTRR = 2, /**< Use MTRR */
L4IO_MEM_ATTR_MASK = 0xf,
- /** Use reserved area for mapping I/O memory. Flag only valid
- * for l4io_request_iomem_region() */
- L4IO_MEM_USE_RESERVED_AREA = 0x10,
-
// combinations
L4IO_MEM_WRITE_COMBINED = L4IO_MEM_USE_MTRR | L4IO_MEM_CACHED,
+
+
+ /** Use reserved area for mapping I/O memory. Flag only valid
+ * for l4io_request_iomem_region() */
+ L4IO_MEM_USE_RESERVED_AREA = 0x40 << 8,
+ /** Eagerly map the I/O memory. Passthrough to the l4re-rm. */
+ L4IO_MEM_EAGER_MAP = 0x80 << 8,
};
/**
__map_iomem(l4_addr_t phys, l4_addr_t* virt, unsigned long size, int flags)
{
Cap<L4Re::Dataspace> iomem = L4::cap_cast<L4Re::Dataspace>(vbus());
+ unsigned char align = L4_PAGESHIFT;
- int res = L4Re::Env::env()->rm()->attach(virt, size,
- *virt
- ? (flags & L4IO_MEM_USE_RESERVED_AREA ? L4Re::Rm::In_area : 0)
- : L4Re::Rm::Search_addr, iomem, phys);
+ if (size >= L4_SUPERPAGESIZE)
+ align = L4_SUPERPAGESHIFT;
+
+ unsigned long rmflags = 0;
+
+ if (flags & L4IO_MEM_EAGER_MAP)
+ rmflags |= L4Re::Rm::Eager_map;
+
+ if (*virt && (flags & L4IO_MEM_USE_RESERVED_AREA))
+ rmflags |= L4Re::Rm::In_area;
+
+ if (!*virt)
+ rmflags |= L4Re::Rm::Search_addr;
+
+ int res = L4Re::Env::env()->rm()->attach(virt, size, rmflags, iomem, phys, align);
if (res)
{
printf("Cannot attach iomem to virtual address %lx with size %lx: %s(%d).\n",
The contrib directory contains the unmodified contents of
-sqlite-amalgamation-3.7.0.tar.gz
+sqlite-amalgamation-3.7.0.1.tar.gz
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.
+# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.1.
#
# Report bugs to <http://www.sqlite.org>.
#
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.7.0'
-PACKAGE_STRING='sqlite 3.7.0'
+PACKAGE_VERSION='3.7.0.1'
+PACKAGE_STRING='sqlite 3.7.0.1'
PACKAGE_BUGREPORT='http://www.sqlite.org'
ac_unique_file="sqlite3.c"
# 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.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.7.0.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sqlite 3.7.0:";;
+ short | recursive ) echo "Configuration of sqlite 3.7.0.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sqlite configure 3.7.0
+sqlite configure 3.7.0.1
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
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.0, which was
+It was created by sqlite $as_me 3.7.0.1, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='sqlite'
- VERSION='3.7.0'
+ VERSION='3.7.0.1'
cat >>confdefs.h <<_ACEOF
# 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.0, which was
+This file was extended by sqlite $as_me 3.7.0.1, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-sqlite config.status 3.7.0
+sqlite config.status 3.7.0.1
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
#
AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.7.0, http://www.sqlite.org)
+AC_INIT(sqlite, 3.7.0.1, http://www.sqlite.org)
AC_CONFIG_SRCDIR([sqlite3.c])
# Use automake.
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.7.0. By combining all the individual C code files into this
+** version 3.7.0.1. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a one translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.7.0"
+#define SQLITE_VERSION "3.7.0.1"
#define SQLITE_VERSION_NUMBER 3007000
-#define SQLITE_SOURCE_ID "2010-07-20 20:23:38 13ed106c8c279422a6159e28c6887d13a88b7b8b"
+#define SQLITE_SOURCE_ID "2010-08-04 12:31:11 042a1abb030a0711386add7eb6e10832cc8b0f57"
/*
** CAPI3REF: Run-Time Library Version Numbers
** <dd>^This parameter returns the approximate number of of bytes of heap
** memory used by all pager caches associated with the database connection.
** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
-** checked out.</dd>)^
+** </dd>
** </dl>
*/
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
memset( pFile, 0, sizeof(*pFile) );
- OSTRACE( "OPEN want %d\n", flags ));
+ OSTRACE(( "OPEN want %d\n", flags ));
if( flags & SQLITE_OPEN_READWRITE ){
ulOpenMode |= OPEN_ACCESS_READWRITE;
if( p->inTrans>pBt->inTransaction ){
pBt->inTransaction = p->inTrans;
}
-#ifndef SQLITE_OMIT_SHARED_CACHE
if( wrflag ){
+ MemPage *pPage1 = pBt->pPage1;
+#ifndef SQLITE_OMIT_SHARED_CACHE
assert( !pBt->pWriter );
pBt->pWriter = p;
pBt->isExclusive = (u8)(wrflag>1);
- }
#endif
+
+ /* If the db-size header field is incorrect (as it may be if an old
+ ** client has been writing the database file), update it now. Doing
+ ** this sooner rather than later means the database size can safely
+ ** re-read the database size from page 1 if a savepoint or transaction
+ ** rollback occurs within the transaction.
+ */
+ if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){
+ rc = sqlite3PagerWrite(pPage1->pDbPage);
+ if( rc==SQLITE_OK ){
+ put4byte(&pPage1->aData[28], pBt->nPage);
+ }
+ }
+ }
}
/* Could not found an existing table or index to use as the RHS b-tree.
** We will have to generate an ephemeral table to do the job.
*/
+ double savedNQueryLoop = pParse->nQueryLoop;
int rMayHaveNull = 0;
eType = IN_INDEX_EPH;
if( prNotFound ){
*prNotFound = rMayHaveNull = ++pParse->nMem;
- }else if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
- eType = IN_INDEX_ROWID;
+ }else{
+ testcase( pParse->nQueryLoop>(double)1 );
+ pParse->nQueryLoop = (double)1;
+ if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
+ eType = IN_INDEX_ROWID;
+ }
}
sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID);
+ pParse->nQueryLoop = savedNQueryLoop;
}else{
pX->iTable = iTab;
}
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.7.0"
+#define SQLITE_VERSION "3.7.0.1"
#define SQLITE_VERSION_NUMBER 3007000
-#define SQLITE_SOURCE_ID "2010-07-20 20:23:38 13ed106c8c279422a6159e28c6887d13a88b7b8b"
+#define SQLITE_SOURCE_ID "2010-08-04 12:31:11 042a1abb030a0711386add7eb6e10832cc8b0f57"
/*
** CAPI3REF: Run-Time Library Version Numbers
** <dd>^This parameter returns the approximate number of of bytes of heap
** memory used by all pager caches associated with the database connection.
** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
-** checked out.</dd>)^
+** </dd>
** </dl>
*/
#define SQLITE_DBSTATUS_LOOKASIDE_USED 0
Name: SQLite
Description: SQL database engine
-Version: 3.7.0
+Version: 3.7.0.1
Libs: -L${libdir} -lsqlite3
Libs.private: -ldl -lpthread
Cflags: -I${includedir}
#include <sys/stat.h>
#include <sys/ioctl.h>
-#include <errno.h>
+#include <dirent.h>
#include <cstdio>
class Pers_dir : public Node
{
+private:
+ typedef cxx::Avl_tree<Node, Node_get_key, Path_avl_tree_compare> Tree;
+ Tree _tree;
+
public:
Pers_dir(const char *name, mode_t mode)
: Node(name, (mode & 0777) | __S_IFDIR) {}
Ref_ptr<Node> find_path(cxx::String);
int add_node(Ref_ptr<Node> const &);
-private:
- typedef cxx::Avl_tree<Node, Node_get_key, Path_avl_tree_compare> Tree;
- Tree _tree;
+ typedef Tree::Const_iterator Const_iterator;
+ Const_iterator begin() const { return _tree.begin(); }
+ Const_iterator end() const { return _tree.end(); }
};
Ref_ptr<Node> Pers_dir::find_path(cxx::String path)
{
public:
explicit Tmpfs_dir(Ref_ptr<Pers_dir> const &d) throw()
- : _dir(d) {}
+ : _dir(d), _getdents_state(false) {}
int get_entry(const char *, int, mode_t, Ref_ptr<File> *) throw();
+ ssize_t getdents(char *, size_t) throw();
int fstat64(struct stat64 *buf) const throw();
int mkdir(const char *, mode_t) throw();
int unlink(const char *) throw();
Ref_ptr<Node> *ret, cxx::String *remaining = 0);
Ref_ptr<Pers_dir> _dir;
+ bool _getdents_state;
+ Pers_dir::Const_iterator _getdents_iter;
};
class Tmpfs_file : public Be_file
int Tmpfs_file::fstat64(struct stat64 *buf) const throw()
{
+ _file->info()->st_size = _file->data().size();
memcpy(buf, _file->info(), sizeof(*buf));
return 0;
}
return 0;
}
+ssize_t
+Tmpfs_dir::getdents(char *buf, size_t sz) throw()
+{
+ struct dirent64 *d = (struct dirent64 *)buf;
+ ssize_t ret = 0;
+
+ if (!_getdents_state)
+ {
+ _getdents_iter = _dir->begin();
+ _getdents_state = true;
+ }
+ else if (_getdents_iter == _dir->end())
+ {
+ _getdents_state = false;
+ return 0;
+ }
+
+ for (; _getdents_iter != _dir->end(); ++_getdents_iter)
+ {
+ unsigned l = strlen(_getdents_iter->path()) + 1;
+ if (l > sizeof(d->d_name))
+ l = sizeof(d->d_name);
+
+ unsigned n = offsetof (struct dirent64, d_name) + l;
+
+ if (n > sz)
+ break;
+
+ d->d_ino = 1;
+ d->d_off = 0;
+ memcpy(d->d_name, _getdents_iter->path(), l);
+ d->d_reclen = n;
+ d->d_type = DT_REG;
+ ret += n;
+ sz -= n;
+ d = (struct dirent64 *)((unsigned long)d + n);
+ }
+
+ return ret;
+}
+
int
Tmpfs_dir::fstat64(struct stat64 *buf) const throw()
{