diff options
author | marcel <marcel@FreeBSD.org> | 2003-05-15 05:04:44 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-05-15 05:04:44 +0000 |
commit | 1edc7465a0eedb6ceb50376d0ef2bcd13a40e03d (patch) | |
tree | 3f5df6e13c7fb693b40b2b9c2206dc4cd8e0f381 /sys/contrib/ia64/libuwx/src/uwx_bstream.h | |
download | FreeBSD-src-1edc7465a0eedb6ceb50376d0ef2bcd13a40e03d.zip FreeBSD-src-1edc7465a0eedb6ceb50376d0ef2bcd13a40e03d.tar.gz |
This is beta4 of libuwx; an ia64 stack unwinder. This code is made
available by Hewlett-Packard under the MIT license. The unwinder is
small, clean and fast and needed little adaptation for use in the
kernel.
This import has embedded in it the changes needed to make it build
in a kernel environment.
To optimize the common case, the kernel will minimize the number
of registers saved by not saving the preserved registers. In case
access to preserved registers is needed (signal handling, ptrace)
the kernel will unwind to the context of the syscall or exception.
For this we need an unwinder.
Approved by: re (blanket)
Diffstat (limited to 'sys/contrib/ia64/libuwx/src/uwx_bstream.h')
-rw-r--r-- | sys/contrib/ia64/libuwx/src/uwx_bstream.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sys/contrib/ia64/libuwx/src/uwx_bstream.h b/sys/contrib/ia64/libuwx/src/uwx_bstream.h new file mode 100644 index 0000000..1a64e89 --- /dev/null +++ b/sys/contrib/ia64/libuwx/src/uwx_bstream.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2002,2003 Hewlett-Packard Company + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +struct uwx_bstream { + copyin_cb copyin; + intptr_t cb_token; + uint64_t source; + uint64_t buf; + unsigned char *bufp; + int nbuf; + unsigned int ntotal; + int request; + int peekc; +}; + +/* uwx_init_bstream: initialize a byte stream for reading */ + +extern void uwx_init_bstream( + struct uwx_bstream *bstream, + struct uwx_env *env, + uint64_t source, + unsigned int len, + int request); + + +/* uwx_get_byte: read the next byte from the byte stream */ + +extern int uwx_get_byte(struct uwx_bstream *bstream); + + +/* uwx_unget_byte: push a byte back onto the byte stream */ + +extern int uwx_unget_byte(struct uwx_bstream *bstream, int b); + + +/* uwx_get_uleb128: read a ULEB128 value from the byte stream */ + +extern int uwx_get_uleb128(struct uwx_bstream *bstream, uint64_t *val); |