Changeset 46c20c8 in mainline for boot/generic/include


Ignore:
Timestamp:
2010-11-26T20:08:10Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
45df59a
Parents:
fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
boot/generic/include
Files:
7 added
8 moved

Legend:

Unmodified
Added
Removed
  • boot/generic/include/align.h

    rfb150d78 r46c20c8  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
    30  * @{
    31  */
    32 /** @file
     29/**
     30 * @file
     31 * @brief Macros for making values and addresses aligned.
    3332 */
    3433
     
    3635#define BOOT_ALIGN_H_
    3736
     37/** Align to the nearest lower address.
     38 *
     39 * @param s Address or size to be aligned.
     40 * @param a Size of alignment, must be power of 2.
     41 */
     42#define ALIGN_DOWN(s, a)  ((s) & ~((a) - 1))
     43
    3844/** Align to the nearest higher address.
    3945 *
    40  * @param addr Address or size to be aligned.
    41  * @param align Size of alignment, must be power of 2.
     46 * @param s Address or size to be aligned.
     47 * @param a Size of alignment, must be power of 2.
    4248 */
    43 #define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1))
     49#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((a) - 1))
    4450
    4551#endif
  • boot/generic/include/balloc.h

    rfb150d78 r46c20c8  
    3030#define BOOT_BALLOC_H_
    3131
    32 #include <types.h>
     32#include <typedefs.h>
    3333
    3434typedef struct {
     
    3737} ballocs_t;
    3838
    39 extern void balloc_init(ballocs_t *ball, uintptr_t base, uintptr_t kernel_base);
    40 extern void *balloc(size_t size, size_t alignment);
    41 extern void *balloc_rebase(void *ptr);
     39extern void balloc_init(ballocs_t *, void *, uintptr_t, size_t);
     40extern void *balloc(size_t, size_t);
     41extern void *balloc_rebase(void *);
    4242
    4343#endif
  • boot/generic/include/macros.h

    rfb150d78 r46c20c8  
    11/*
    2  * Copyright (c) 2009 Martin Decky
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libc
    30  * @{
    31  */
    3229/** @file
    3330 */
     
    3734
    3835#define min(a, b)  ((a) < (b) ? (a) : (b))
    39 #define max(a, b)  ((a) > (b) ? (a) : (b))
    4036
    41 #define SIZE2KB(size)  ((size) >> 10)
    42 #define SIZE2MB(size)  ((size) >> 20)
    43 
    44 #define KB2SIZE(kb)  ((kb) << 10)
    45 #define MB2SIZE(mb)  ((mb) << 20)
     37#define isdigit(d)  (((d) >= '0') && ((d) <= '9'))
    4638
    4739#define STRING(arg)      STRING_ARG(arg)
  • boot/generic/include/memstr.h

    rfb150d78 r46c20c8  
    11/*
    2  * Copyright (c) 2009 Martin Decky
     2 * Copyright (c) 2001-2004 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
    30  * @{
    31  */
    3229/** @file
    3330 */
     
    3633#define BOOT_MEMSTR_H_
    3734
    38 extern void memcpy(void *dst, const void *src, unsigned int cnt);
     35#include <typedefs.h>
     36
     37extern void *memcpy(void *, const void *, size_t);
    3938
    4039#endif
  • boot/generic/include/printf.h

    rfb150d78 r46c20c8  
    2727 */
    2828
    29 /** @addtogroup generic
    30  * @{
    31  */
    3229/** @file
    3330 */
    3431
    35 #ifndef BOOT_STRING_H_
    36 #define BOOT_STRING_H_
     32#ifndef BOOT_PRINT_H_
     33#define BOOT_PRINT_H_
    3734
    38 #include <types.h>
     35#include <typedefs.h>
     36#include <stdarg.h>
    3937
    40 extern size_t strlen(const char *str);
    41 extern int strcmp(const char *src, const char *dst);
    42 extern int strncmp(const char *src, const char *dst, size_t len);
    43 extern void strncpy(char *dest, const char *src, size_t len);
    44 extern unative_t atoi(const char *text);
    45 extern void *memmove(void *dst, const void *src, size_t len);
     38#ifndef NVERIFY_PRINTF
     39
     40#define PRINTF_ATTRIBUTE(start, end) \
     41        __attribute__((format(gnu_printf, start, end)))
     42
     43#else /* NVERIFY_PRINTF */
     44
     45#define PRINTF_ATTRIBUTE(start, end)
     46
     47#endif /* NVERIFY_PRINTF */
     48
     49#define EOF  (-1)
     50
     51extern int puts(const char *);
     52extern int printf(const char *, ...)
     53    PRINTF_ATTRIBUTE(1, 2);
     54extern int vprintf(const char *, va_list);
    4655
    4756#endif
  • boot/generic/include/stdarg.h

    rfb150d78 r46c20c8  
    2727 */
    2828
    29 /** @addtogroup generic
    30  * @{
    31  */
    3229/** @file
    3330 */
    3431
    35 #ifndef STDARG_H__
    36 #define STDARG_H__
     32#ifndef BOOT_STDARG_H__
     33#define BOOT_STDARG_H__
    3734
    3835typedef __builtin_va_list va_list;
    3936
    40 #define va_start(ap, last)   __builtin_va_start(ap, last)
    41 #define va_arg(ap, type)     __builtin_va_arg(ap, type)
    42 #define va_end(ap)           __builtin_va_end(ap)
     37#define va_start(ap, last)  __builtin_va_start(ap, last)
     38#define va_arg(ap, type)    __builtin_va_arg(ap, type)
     39#define va_end(ap)          __builtin_va_end(ap)
    4340
    4441#endif
  • boot/generic/include/stdint.h

    rfb150d78 r46c20c8  
    2727 */
    2828
    29 /** @addtogroup libc
    30  * @{
    31  */
    3229/** @file
    3330 */
    3431
    35 #ifndef LIBC_STDINT_H_
    36 #define LIBC_STDINT_H_
     32#ifndef BOOT_STDINT_H_
     33#define BOOT_STDINT_H_
    3734
    38 /* Definitions of types with fixed size */
    39 #include <libarch/types.h>
     35#define INT8_MIN  INT8_C(0x80)
     36#define INT8_MAX  INT8_C(0x7F)
    4037
    41 #define MAX_INT8 (0x7F)
    42 #define MIN_INT8 (0x80)
    43 #define MAX_UINT8 (0xFFu)
    44 #define MIN_UINT8 (0u)
     38#define UINT8_MIN  UINT8_C(0)
     39#define UINT8_MAX  UINT8_C(0xFF)
    4540
    46 #define MAX_INT16 (0x7FFF)
    47 #define MIN_INT16 (0x8000)
    48 #define MAX_UINT16 (0xFFFFu)
    49 #define MIN_UINT16 (0u)
     41#define INT16_MIN  INT16_C(0x8000)
     42#define INT16_MAX  INT16_C(0x7FFF)
    5043
    51 #define MAX_INT32 (0x7FFFFFFF)
    52 #define MIN_INT32 (0x80000000)
    53 #define MAX_UINT32 (0xFFFFFFFFu)
    54 #define MIN_UINT32 (0u)
     44#define UINT16_MIN  UINT16_C(0)
     45#define UINT16_MAX  UINT16_C(0xFFFF)
    5546
    56 #define MAX_INT64 (0x7FFFFFFFFFFFFFFFll)
    57 #define MIN_INT64 (0x8000000000000000ll)
    58 #define MAX_UINT64 (0xFFFFFFFFFFFFFFFFull)
    59 #define MIN_UINT64 (0ull)
     47#define INT32_MIN  INT32_C(0x80000000)
     48#define INT32_MAX  INT32_C(0x7FFFFFFF)
     49
     50#define UINT32_MIN  UINT32_C(0)
     51#define UINT32_MAX  UINT32_C(0xFFFFFFFF)
     52
     53#define INT64_MIN  INT64_C(0x8000000000000000)
     54#define INT64_MAX  INT64_C(0x7FFFFFFFFFFFFFFF)
     55
     56#define UINT64_MIN  UINT64_C(0)
     57#define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
    6058
    6159#endif
  • boot/generic/include/version.h

    rfb150d78 r46c20c8  
    11/*
    2  * Copyright (c) 2005
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup ppc32debug
    30  * @{
    31  */
    3229/** @file
    3330 */
    3431
    35 #ifndef KERN_ppc32_DEBUG_H_
    36 #define KERN_ppc32_DEBUG_H_
     32#ifndef BOOT_VERSION_H_
     33#define BOOT_VERSION_H_
     34
     35extern void version_print(void);
    3736
    3837#endif
Note: See TracChangeset for help on using the changeset viewer.