blob: ca464bb3679cdb5ade8b5188c754b4fd3d78ce97 [file] [log] [blame]
Orit Wasserman9fb26642012-08-06 21:42:50 +03001
Eduardo Habkost04509ad2012-10-23 19:44:02 -02002/* Common header file that is included by all of QEMU.
3 *
4 * This file is supposed to be included only by .c files. No header file should
5 * depend on qemu-common.h, as this would easily lead to circular header
6 * dependencies.
7 *
8 * If a header file uses a definition from qemu-common.h, that definition
9 * must be moved to a separate header file, and the header that uses it
10 * must include that header.
11 */
pbrookfaf07962007-11-11 02:51:17 +000012#ifndef QEMU_COMMON_H
13#define QEMU_COMMON_H
14
Paolo Bonzini1de7afc2012-12-17 18:20:00 +010015#include "qemu/compiler.h"
Kevin Wolfbeb6f0d2010-01-15 12:56:41 +010016#include "config-host.h"
Paolo Bonzini1de7afc2012-12-17 18:20:00 +010017#include "qemu/typedefs.h"
Kevin Wolfbeb6f0d2010-01-15 12:56:41 +010018
Paolo Bonzini332ae282011-07-28 12:10:28 +020019#if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__)
20#define WORDS_ALIGNED
21#endif
22
Blue Swirl082b5552011-03-27 09:04:57 +000023#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
Paolo Bonzini24ebf5f2010-02-18 21:25:23 +010024
pbrookfaf07962007-11-11 02:51:17 +000025/* we put basic includes here to avoid repeating them in device drivers */
26#include <stdlib.h>
27#include <stdio.h>
28#include <stdarg.h>
Paul Brook11165822010-06-13 19:00:50 +010029#include <stdbool.h>
pbrookfaf07962007-11-11 02:51:17 +000030#include <string.h>
balrogc8906842008-11-12 17:18:41 +000031#include <strings.h>
pbrookfaf07962007-11-11 02:51:17 +000032#include <inttypes.h>
33#include <limits.h>
34#include <time.h>
35#include <ctype.h>
36#include <errno.h>
37#include <unistd.h>
38#include <fcntl.h>
39#include <sys/stat.h>
Hervé Poussineaudcfd0862011-03-06 13:23:13 +000040#include <sys/time.h>
Paul Brook55616502009-05-13 20:51:49 +010041#include <assert.h>
Alexandre Raymond86f69a92011-06-01 22:21:30 -040042#include <signal.h>
Anthony Liguori14015302011-08-20 22:18:37 -050043#include <glib.h>
pbrookfaf07962007-11-11 02:51:17 +000044
Blue Swirl082b5552011-03-27 09:04:57 +000045#ifdef _WIN32
Paolo Bonzini9c17d612012-12-17 18:20:04 +010046#include "sysemu/os-win32.h"
Blue Swirl082b5552011-03-27 09:04:57 +000047#endif
48
49#ifdef CONFIG_POSIX
Paolo Bonzini9c17d612012-12-17 18:20:04 +010050#include "sysemu/os-posix.h"
Blue Swirl082b5552011-03-27 09:04:57 +000051#endif
52
pbrookfaf07962007-11-11 02:51:17 +000053#ifndef O_LARGEFILE
54#define O_LARGEFILE 0
55#endif
56#ifndef O_BINARY
57#define O_BINARY 0
58#endif
Juan Quintela0e74e662009-07-27 16:12:57 +020059#ifndef MAP_ANONYMOUS
60#define MAP_ANONYMOUS MAP_ANON
61#endif
pbrookfaf07962007-11-11 02:51:17 +000062#ifndef ENOMEDIUM
63#define ENOMEDIUM ENODEV
64#endif
Anthony Liguori4c955382009-07-28 15:48:31 -050065#if !defined(ENOTSUP)
Juan Quintela2880bc32009-07-27 16:13:22 +020066#define ENOTSUP 4096
67#endif
Paolo Bonzini2084a8e2012-05-10 09:27:50 +020068#if !defined(ECANCELED)
69#define ECANCELED 4097
70#endif
Gerd Hoffmann3c9405a2010-10-07 11:50:45 +020071#ifndef TIME_MAX
72#define TIME_MAX LONG_MAX
73#endif
pbrookfaf07962007-11-11 02:51:17 +000074
Stefan Weilc0fd2602012-02-01 21:04:13 +010075/* HOST_LONG_BITS is the size of a native pointer in bits. */
76#if UINTPTR_MAX == UINT32_MAX
77# define HOST_LONG_BITS 32
78#elif UINTPTR_MAX == UINT64_MAX
79# define HOST_LONG_BITS 64
80#else
81# error Unknown pointer size
82#endif
83
Juan Quintela6114fdb2009-07-27 16:12:59 +020084#ifndef CONFIG_IOVEC
85#define CONFIG_IOVEC
aliguoribf9298b2008-12-05 20:05:26 +000086struct iovec {
87 void *iov_base;
88 size_t iov_len;
89};
Christoph Hellwige2a305f2010-01-26 14:49:08 +010090/*
91 * Use the same value as Linux for now.
92 */
93#define IOV_MAX 1024
blueswir1331dadd2008-12-06 19:44:56 +000094#else
95#include <sys/uio.h>
aliguoribf9298b2008-12-05 20:05:26 +000096#endif
97
Stefan Weilf8684452010-10-22 23:03:30 +020098typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
99 GCC_FMT_ATTR(2, 3);
100
pbrookfaf07962007-11-11 02:51:17 +0000101#ifdef _WIN32
pbrookfaf07962007-11-11 02:51:17 +0000102#define fsync _commit
Stefan Weil371c6482012-03-10 11:14:31 +0100103#if !defined(lseek)
104# define lseek _lseeki64
105#endif
Blue Swirl64b85a82011-01-23 16:21:20 +0000106int qemu_ftruncate64(int, int64_t);
Stefan Weil371c6482012-03-10 11:14:31 +0100107#if !defined(ftruncate)
108# define ftruncate qemu_ftruncate64
109#endif
pbrookfaf07962007-11-11 02:51:17 +0000110
pbrookfaf07962007-11-11 02:51:17 +0000111static inline char *realpath(const char *path, char *resolved_path)
112{
113 _fullpath(resolved_path, path, _MAX_PATH);
114 return resolved_path;
115}
pbrookfaf07962007-11-11 02:51:17 +0000116#endif
117
Paolo Bonzini946fb272011-09-12 13:57:37 +0200118/* icount */
119void configure_icount(const char *option);
120extern int use_icount;
121
pbrookfaf07962007-11-11 02:51:17 +0000122/* FIXME: Remove NEED_CPU_H. */
123#ifndef NEED_CPU_H
124
Paolo Bonzini1de7afc2012-12-17 18:20:00 +0100125#include "qemu/osdep.h"
126#include "qemu/bswap.h"
pbrookfaf07962007-11-11 02:51:17 +0000127
128#else
129
130#include "cpu.h"
131
132#endif /* !defined(NEED_CPU_H) */
133
Andreas Färber3bbbee12011-05-29 19:42:51 +0200134/* main function, renamed */
135#if defined(CONFIG_COCOA)
136int qemu_main(int argc, char **argv, char **envp);
137#endif
138
balrogf6503052008-02-17 11:42:19 +0000139void qemu_get_timedate(struct tm *tm, int offset);
140int qemu_timedate_diff(struct tm *tm);
141
Peter Maydellc8057f92012-08-02 13:45:54 +0100142/**
143 * is_help_option:
144 * @s: string to test
145 *
146 * Check whether @s is one of the standard strings which indicate
147 * that the user is asking for a list of the valid values for a
148 * command option like -cpu or -M. The current accepted strings
149 * are 'help' and '?'. '?' is deprecated (it is a shell wildcard
150 * which makes it annoying to use in a reliable way) but provided
151 * for backwards compatibility.
152 *
153 * Returns: true if @s is a request for a list.
154 */
155static inline bool is_help_option(const char *s)
156{
157 return !strcmp(s, "?") || !strcmp(s, "help");
158}
159
pbrookfaf07962007-11-11 02:51:17 +0000160/* cutils.c */
161void pstrcpy(char *buf, int buf_size, const char *str);
Dmitry Fleytman2a025ae2012-07-09 08:50:43 +0200162void strpadcpy(char *buf, int buf_size, const char *str, char pad);
pbrookfaf07962007-11-11 02:51:17 +0000163char *pstrcat(char *buf, int buf_size, const char *s);
164int strstart(const char *str, const char *val, const char **ptr);
165int stristart(const char *str, const char *val, const char **ptr);
Blue Swirld43277c2009-07-01 18:24:44 +0000166int qemu_strnlen(const char *s, int max_len);
pbrookfaf07962007-11-11 02:51:17 +0000167time_t mktimegm(struct tm *tm);
blueswir1ad46db92008-12-11 19:37:54 +0000168int qemu_fls(int i);
Christoph Hellwig6f1953c2009-09-04 19:01:32 +0200169int qemu_fdatasync(int fd);
Paolo Bonzinidb1a4972010-03-10 11:38:55 +0100170int fcntl_setfl(int fd, int flag);
Stefan Berger443916d2011-09-28 06:41:32 -0400171int qemu_parse_fd(const char *param);
Jes Sorensend8427002010-12-09 14:17:24 +0100172
Jes Sorensend7142452011-01-26 11:54:58 +0100173/*
174 * strtosz() suffixes used to specify the default treatment of an
175 * argument passed to strtosz() without an explicit suffix.
176 * These should be defined using upper case characters in the range
177 * A-Z, as strtosz() will use qemu_toupper() on the given argument
178 * prior to comparison.
179 */
Jes Sorensend8427002010-12-09 14:17:24 +0100180#define STRTOSZ_DEFSUFFIX_TB 'T'
181#define STRTOSZ_DEFSUFFIX_GB 'G'
182#define STRTOSZ_DEFSUFFIX_MB 'M'
183#define STRTOSZ_DEFSUFFIX_KB 'K'
184#define STRTOSZ_DEFSUFFIX_B 'B'
Jes Sorensen70b4f4b2011-01-05 11:41:02 +0100185int64_t strtosz(const char *nptr, char **end);
186int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix);
Joerg Roedela732e1b2011-07-07 16:13:11 +0200187int64_t strtosz_suffix_unit(const char *nptr, char **end,
188 const char default_suffix, int64_t unit);
pbrookfaf07962007-11-11 02:51:17 +0000189
Blue Swirl37022082009-08-15 07:51:59 +0000190/* path.c */
191void init_paths(const char *prefix);
192const char *path(const char *pathname);
193
blueswir1cd390082008-11-16 13:53:32 +0000194#define qemu_isalnum(c) isalnum((unsigned char)(c))
195#define qemu_isalpha(c) isalpha((unsigned char)(c))
196#define qemu_iscntrl(c) iscntrl((unsigned char)(c))
197#define qemu_isdigit(c) isdigit((unsigned char)(c))
198#define qemu_isgraph(c) isgraph((unsigned char)(c))
199#define qemu_islower(c) islower((unsigned char)(c))
200#define qemu_isprint(c) isprint((unsigned char)(c))
201#define qemu_ispunct(c) ispunct((unsigned char)(c))
202#define qemu_isspace(c) isspace((unsigned char)(c))
203#define qemu_isupper(c) isupper((unsigned char)(c))
204#define qemu_isxdigit(c) isxdigit((unsigned char)(c))
205#define qemu_tolower(c) tolower((unsigned char)(c))
206#define qemu_toupper(c) toupper((unsigned char)(c))
207#define qemu_isascii(c) isascii((unsigned char)(c))
208#define qemu_toascii(c) toascii((unsigned char)(c))
209
Jes Sorensenb152aa82010-10-26 10:39:26 +0200210void *qemu_oom_check(void *ptr);
aurel32ca10f862008-04-11 21:35:42 +0000211
Juan Quintela7c7c0622010-01-20 00:56:09 +0100212ssize_t qemu_write_full(int fd, const void *buf, size_t count)
213 QEMU_WARN_UNUSED_RESULT;
Paolo Bonzini993295f2011-09-17 16:27:59 +0200214ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags)
215 QEMU_WARN_UNUSED_RESULT;
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200216ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
Paolo Bonzini993295f2011-09-17 16:27:59 +0200217 QEMU_WARN_UNUSED_RESULT;
Kevin Wolf40ff6d72009-12-02 12:24:42 +0100218
219#ifndef _WIN32
220int qemu_pipe(int pipefd[2]);
221#endif
222
Blue Swirl00aa0042011-07-23 20:04:29 +0000223#ifdef _WIN32
Stefan Weil58455eb2012-09-28 19:07:39 +0200224/* MinGW needs type casts for the 'buf' and 'optval' arguments. */
225#define qemu_getsockopt(sockfd, level, optname, optval, optlen) \
226 getsockopt(sockfd, level, optname, (void *)optval, optlen)
227#define qemu_setsockopt(sockfd, level, optname, optval, optlen) \
228 setsockopt(sockfd, level, optname, (const void *)optval, optlen)
Blue Swirl00aa0042011-07-23 20:04:29 +0000229#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, (void *)buf, len, flags)
Stefan Weil73062df2012-09-22 21:13:28 +0200230#define qemu_sendto(sockfd, buf, len, flags, destaddr, addrlen) \
231 sendto(sockfd, (const void *)buf, len, flags, destaddr, addrlen)
Blue Swirl00aa0042011-07-23 20:04:29 +0000232#else
Stefan Weil58455eb2012-09-28 19:07:39 +0200233#define qemu_getsockopt(sockfd, level, optname, optval, optlen) \
234 getsockopt(sockfd, level, optname, optval, optlen)
235#define qemu_setsockopt(sockfd, level, optname, optval, optlen) \
236 setsockopt(sockfd, level, optname, optval, optlen)
Blue Swirl00aa0042011-07-23 20:04:29 +0000237#define qemu_recv(sockfd, buf, len, flags) recv(sockfd, buf, len, flags)
Stefan Weil73062df2012-09-22 21:13:28 +0200238#define qemu_sendto(sockfd, buf, len, flags, destaddr, addrlen) \
239 sendto(sockfd, buf, len, flags, destaddr, addrlen)
Blue Swirl00aa0042011-07-23 20:04:29 +0000240#endif
241
pbrook87ecb682007-11-17 17:14:51 +0000242/* Error handling. */
243
Stefan Weile5924d82010-09-23 21:28:03 +0200244void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
pbrook87ecb682007-11-17 17:14:51 +0000245
pbrook87ecb682007-11-17 17:14:51 +0000246struct ParallelIOArg {
247 void *buffer;
248 int count;
249};
250
251typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);
252
Michael S. Tsirkin186993e2010-02-10 21:25:42 +0200253typedef uint64_t pcibus_t;
254
Jan Kiszka4e4fa392012-01-23 20:15:11 +0100255typedef enum LostTickPolicy {
256 LOST_TICK_DISCARD,
257 LOST_TICK_DELAY,
258 LOST_TICK_MERGE,
259 LOST_TICK_SLEW,
Paolo Bonzini1ce05122012-02-02 22:09:44 +0100260 LOST_TICK_MAX
Jan Kiszka4e4fa392012-01-23 20:15:11 +0100261} LostTickPolicy;
262
Anthony PERARD679042f2012-06-21 15:36:23 +0000263typedef struct PCIHostDeviceAddress {
264 unsigned int domain;
265 unsigned int bus;
266 unsigned int slot;
267 unsigned int function;
268} PCIHostDeviceAddress;
269
Jan Kiszkad5ab9712011-08-02 16:10:21 +0200270void tcg_exec_init(unsigned long tb_size);
271bool tcg_enabled(void);
272
273void cpu_exec_init_all(void);
Blue Swirld2053c32010-03-29 19:23:48 +0000274
pbrookb3c77242008-06-30 16:31:04 +0000275/* CPU save/load. */
276void cpu_save(QEMUFile *f, void *opaque);
277int cpu_load(QEMUFile *f, void *opaque, int version_id);
278
aliguori8edac962009-04-24 18:03:45 +0000279/* Unblock cpu */
Jan Kiszka46d62fa2011-02-01 22:15:59 +0100280void qemu_cpu_kick_self(void);
aliguori8edac962009-04-24 18:03:45 +0000281
Marcelo Tosattie82bcec2010-05-04 09:45:22 -0300282/* work queue */
283struct qemu_work_item {
284 struct qemu_work_item *next;
285 void (*func)(void *data);
286 void *data;
287 int done;
288};
289
aliguori0bf46a42009-04-24 18:03:41 +0000290#ifdef CONFIG_USER_ONLY
Andreas Färber75a192a2013-01-05 14:44:08 +0100291static inline void qemu_init_vcpu(void *env)
292{
293}
aliguori0bf46a42009-04-24 18:03:41 +0000294#else
295void qemu_init_vcpu(void *env);
296#endif
297
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200298
299/**
Michael Tokarev2fc8ae12012-06-07 20:22:46 +0400300 * Sends a (part of) iovec down a socket, yielding when the socket is full, or
301 * Receives data into a (part of) iovec from a socket,
302 * yielding when there is no data in the socket.
303 * The same interface as qemu_sendv_recvv(), with added yielding.
304 * XXX should mark these as coroutine_fn
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200305 */
Michael Tokarev2fc8ae12012-06-07 20:22:46 +0400306ssize_t qemu_co_sendv_recvv(int sockfd, struct iovec *iov, unsigned iov_cnt,
307 size_t offset, size_t bytes, bool do_send);
308#define qemu_co_recvv(sockfd, iov, iov_cnt, offset, bytes) \
309 qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, false)
310#define qemu_co_sendv(sockfd, iov, iov_cnt, offset, bytes) \
311 qemu_co_sendv_recvv(sockfd, iov, iov_cnt, offset, bytes, true)
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200312
313/**
Michael Tokarev2fc8ae12012-06-07 20:22:46 +0400314 * The same as above, but with just a single buffer
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200315 */
Michael Tokarev2fc8ae12012-06-07 20:22:46 +0400316ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send);
317#define qemu_co_recv(sockfd, buf, bytes) \
318 qemu_co_send_recv(sockfd, buf, bytes, false)
319#define qemu_co_send(sockfd, buf, bytes) \
320 qemu_co_send_recv(sockfd, buf, bytes, true)
Paolo Bonzini8c5135f2011-09-08 13:46:25 +0200321
aliguori44e3ee82009-01-22 16:59:20 +0000322typedef struct QEMUIOVector {
323 struct iovec *iov;
324 int niov;
325 int nalloc;
aliguori249aa742009-01-26 17:17:52 +0000326 size_t size;
aliguori44e3ee82009-01-22 16:59:20 +0000327} QEMUIOVector;
328
329void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
aliguori522584a2009-03-28 17:46:10 +0000330void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov);
aliguori44e3ee82009-01-22 16:59:20 +0000331void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
Michael Tokarev1b093c42012-03-12 21:28:06 +0400332void qemu_iovec_concat(QEMUIOVector *dst,
333 QEMUIOVector *src, size_t soffset, size_t sbytes);
Stefan Hajnoczi530c0bb2012-11-22 16:06:06 +0100334void qemu_iovec_concat_iov(QEMUIOVector *dst,
335 struct iovec *src_iov, unsigned int src_cnt,
336 size_t soffset, size_t sbytes);
aliguori44e3ee82009-01-22 16:59:20 +0000337void qemu_iovec_destroy(QEMUIOVector *qiov);
aliguoribe959462009-02-05 21:23:54 +0000338void qemu_iovec_reset(QEMUIOVector *qiov);
Michael Tokarevd5e6b162012-06-07 20:21:06 +0400339size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset,
340 void *buf, size_t bytes);
Michael Tokarev03396142012-06-07 20:17:55 +0400341size_t qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,
342 const void *buf, size_t bytes);
Michael Tokarev3d9b4922012-03-10 16:54:23 +0400343size_t qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
344 int fillc, size_t bytes);
aliguori44e3ee82009-01-22 16:59:20 +0000345
Stefan Hajnoczi1a6d39f2012-02-07 13:27:24 +0000346bool buffer_is_zero(const void *buf, size_t len);
347
Jes Sorensen6b837bc2011-03-30 14:16:25 +0200348void qemu_progress_init(int enabled, float min_skip);
349void qemu_progress_end(void);
Jes Sorensen3bfe4db2011-05-09 17:32:20 +0200350void qemu_progress_print(float delta, int max);
Ronnie Sahlberg31459f42012-08-06 18:24:55 +1000351const char *qemu_get_vm_name(void);
Jes Sorensen6b837bc2011-03-30 14:16:25 +0200352
Blue Swirl082b5552011-03-27 09:04:57 +0000353#define QEMU_FILE_TYPE_BIOS 0
354#define QEMU_FILE_TYPE_KEYMAP 1
355char *qemu_find_file(int type, const char *name);
356
357/* OS specific functions */
358void os_setup_early_signal_handling(void);
359char *os_find_datadir(const char *argv0);
360void os_parse_cmd_args(int index, const char *optarg);
361void os_pidfile_error(void);
362
Paul Brookabd0c6b2009-11-20 00:03:47 +0000363/* Convert a byte between binary and BCD. */
364static inline uint8_t to_bcd(uint8_t val)
365{
366 return ((val / 10) << 4) | (val % 10);
367}
368
369static inline uint8_t from_bcd(uint8_t val)
370{
371 return ((val >> 4) * 10) + (val & 0x0f);
372}
373
malc338b9222010-10-30 01:41:01 +0400374/* compute with 96 bit intermediate result: (a*b)/c */
375static inline uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
376{
377 union {
378 uint64_t ll;
379 struct {
380#ifdef HOST_WORDS_BIGENDIAN
381 uint32_t high, low;
382#else
383 uint32_t low, high;
384#endif
385 } l;
386 } u, res;
387 uint64_t rl, rh;
388
389 u.ll = a;
390 rl = (uint64_t)u.l.low * (uint64_t)b;
391 rh = (uint64_t)u.l.high * (uint64_t)b;
392 rh += (rl >> 32);
393 res.l.high = rh / c;
394 res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
395 return res.ll;
396}
397
Stefan Hajnoczi39516902011-11-17 13:40:25 +0000398/* Round number down to multiple */
399#define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m))
400
401/* Round number up to multiple */
402#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
403
Orit Wasserman9fb26642012-08-06 21:42:50 +0300404static inline bool is_power_of_2(uint64_t value)
405{
406 if (!value) {
407 return 0;
408 }
409
410 return !(value & (value - 1));
411}
412
413/* round down to the nearest power of 2*/
414int64_t pow2floor(int64_t value);
415
Paolo Bonzini1de7afc2012-12-17 18:20:00 +0100416#include "qemu/module.h"
Anthony Liguori0bfe3ca2009-05-14 19:29:53 +0100417
Orit Wassermane6546bb2012-08-06 21:42:51 +0300418/*
419 * Implementation of ULEB128 (http://en.wikipedia.org/wiki/LEB128)
420 * Input is limited to 14-bit numbers
421 */
422
423int uleb128_encode_small(uint8_t *out, uint32_t n);
424int uleb128_decode_small(const uint8_t *in, uint32_t *n);
425
pbrookfaf07962007-11-11 02:51:17 +0000426#endif