diff options
author | Neal H. Walfield <neal@gnu.org> | 2009-02-21 21:14:41 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2009-02-21 21:14:41 +0100 |
commit | 759bcbda499afd29b8da5fd47f437b96a6c948cc (patch) | |
tree | 0530a6ff40977412aaf9ec126cfdf7e408ddccec /libviengoos | |
parent | 52ce316a43952dbe15d6072b77f70bb121b3b872 (diff) |
Add sleep and time support.
Diffstat (limited to 'libviengoos')
-rw-r--r-- | libviengoos/headers.m4 | 1 | ||||
-rw-r--r-- | libviengoos/viengoos.h | 1 | ||||
-rw-r--r-- | libviengoos/viengoos/misc.h | 6 | ||||
-rw-r--r-- | libviengoos/viengoos/x86_64/sys.h | 45 |
4 files changed, 53 insertions, 0 deletions
diff --git a/libviengoos/headers.m4 b/libviengoos/headers.m4 index d3f7772..0d62b5d 100644 --- a/libviengoos/headers.m4 +++ b/libviengoos/headers.m4 @@ -29,5 +29,6 @@ AC_CONFIG_LINKS([ sysroot/include/viengoos/bits/ipc.h:libviengoos/viengoos/${arch}/ipc.h sysroot/include/viengoos/bits/debugger.h:libviengoos/viengoos/${arch}/debugger.h + sysroot/include/viengoos/bits/sys.h:libviengoos/viengoos/${arch}/sys.h ]) diff --git a/libviengoos/viengoos.h b/libviengoos/viengoos.h index 01c18bc..9897029 100644 --- a/libviengoos/viengoos.h +++ b/libviengoos/viengoos.h @@ -33,5 +33,6 @@ #include <viengoos/messenger.h> #include <viengoos/misc.h> #include <viengoos/thread.h> +#include <viengoos/bits/sys.h> #endif diff --git a/libviengoos/viengoos/misc.h b/libviengoos/viengoos/misc.h index 8f67606..0c76cbd 100644 --- a/libviengoos/viengoos/misc.h +++ b/libviengoos/viengoos/misc.h @@ -38,6 +38,7 @@ enum rm_method_id VG_read, VG_as_dump, VG_fault, + VG_sleep, }; static inline const char * @@ -53,6 +54,8 @@ vg_method_id_string (int id) return "as_dump"; case VG_fault: return "fault"; + case VG_sleep: + return "sleep"; case VG_folio_alloc: return "folio_alloc"; case VG_folio_free: @@ -131,6 +134,9 @@ RPC(fault, 2, 1, 0, /* Out: */ int, ocount) +/* Wait NANO_SECONDS before replying. */ +RPC(sleep, 1, 0, 0, uint64_t, nano_seconds) + #undef RPC_STUB_PREFIX #undef RPC_ID_PREFIX diff --git a/libviengoos/viengoos/x86_64/sys.h b/libviengoos/viengoos/x86_64/sys.h new file mode 100644 index 0000000..e7ed4a9 --- /dev/null +++ b/libviengoos/viengoos/x86_64/sys.h @@ -0,0 +1,45 @@ +/* bits/sys.h - System definitions, x86-64 version. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Neal H. Walfield <neal@gnu.org>. + + This file is part of the GNU Hurd. + + GNU Hurd is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Hurd 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Hurd. If not, see + <http://www.gnu.org/licenses/>. */ + +#ifndef _VIENGOOS_BITS_SYS_H +#define _VIENGOOS_BITS_SYS_H 1 + +/* The number of ticks since boot (updated by the architecture + dependency code). */ +struct vg_time +{ + union + { + struct + { + /* The number of nanoseconds since boot. */ + uint64_t ns_since_boot; + /* The clocks frequency in Hz. */ + uint64_t frequency; + }; + char raw[PAGESIZE]; + }; +}; + +/* The location of the time page. */ +#define VG_TIME \ + ((volatile struct vg_time *) ((UINT64_C (1) << 47) - PAGESIZE)) + +#endif |