diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-04-04 15:00:34 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-04-04 15:00:34 -0700 |
commit | 2cd336282f7b3411cf6f384d82487a11e1ccfc1e (patch) | |
tree | 9977477d71edcbde1dd382aaa131c03fafee232a /com32/include/syslinux | |
parent | 0622cf1442f4f04c12ad91e0652b97f2a01c1e93 (diff) | |
parent | 390a4bf409a4574fe3272adf9f873ef78b78c167 (diff) | |
download | syslinux-2cd336282f7b3411cf6f384d82487a11e1ccfc1e.tar.gz |
Merge branch 'master' into new-shuffler
Conflicts:
com32/lib/syslinux/memmap.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/include/syslinux')
-rw-r--r-- | com32/include/syslinux/align.h | 47 | ||||
-rw-r--r-- | com32/include/syslinux/config.h | 1 | ||||
-rw-r--r-- | com32/include/syslinux/keyboard.h | 2 | ||||
-rw-r--r-- | com32/include/syslinux/memscan.h | 38 |
4 files changed, 87 insertions, 1 deletions
diff --git a/com32/include/syslinux/align.h b/com32/include/syslinux/align.h new file mode 100644 index 00000000..5b01bf27 --- /dev/null +++ b/com32/include/syslinux/align.h @@ -0,0 +1,47 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2009 Intel Corporation; author H. Peter Anvin + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_ALIGN_H +#define _SYSLINUX_ALIGN_H + +#include <stdint.h> + +static inline uintptr_t __align_down(uintptr_t __p, uintptr_t __a) +{ + return __p & ~(__a - 1); +} +static inline uintptr_t __align_up(uintptr_t __p, uintptr_t __a) +{ + return (__p + __a - 1) & ~(__a - 1); +} + +#define ALIGN_UP(p,a) ((__typeof__(p))__align_up((uintptr_t)(p), (a))) +#define ALIGN_DOWN(p,a) ((__typeof__(p))__align_down((uintptr_t)(p), (a))) +#define ALIGN_UP_FOR(p,t) ALIGN_UP(p,sizeof(t)) +#define ALIGN_DOWN_FOR(p,t) ALIGN_DOWN(p,sizeof(t)) + +#endif /* _SYSLINUX_ALIGN_H */ diff --git a/com32/include/syslinux/config.h b/com32/include/syslinux/config.h index ed4bf247..ade2c4b1 100644 --- a/com32/include/syslinux/config.h +++ b/com32/include/syslinux/config.h @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved + * Copyright 2009 Intel Corporation; author: H. Peter Anvin * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/com32/include/syslinux/keyboard.h b/com32/include/syslinux/keyboard.h index 9d4f1409..8f21ad07 100644 --- a/com32/include/syslinux/keyboard.h +++ b/com32/include/syslinux/keyboard.h @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- * * - * Copyright 2009 H. Peter Anvin - All Rights Reserved + * Copyright 2009 Intel Corporation; author: H. Peter Anvin * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/com32/include/syslinux/memscan.h b/com32/include/syslinux/memscan.h new file mode 100644 index 00000000..24c4edaf --- /dev/null +++ b/com32/include/syslinux/memscan.h @@ -0,0 +1,38 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2007-2009 H. Peter Anvin - All Rights Reserved + * Copyright 2009 Intel Corporation; author: H. Peter Anvin + * + * 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. + * + * ----------------------------------------------------------------------- */ + +#ifndef _SYSLINUX_MEMSCAN_H +#define _SYSLINUX_MEMSCAN_H + +#include <stdbool.h> +#include <syslinux/movebits.h> /* addr_t */ + +typedef int (*scan_memory_callback_t)(void *, addr_t, addr_t, bool); +int syslinux_scan_memory(scan_memory_callback_t callback, void *data); + +#endif /* _SYSLINUX_MEMSCAN_H */ |