You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
865 B

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2014-2020. All rights reserved.
* Description: boot
* Author: SmartMedia_BSP
* Create: 2014-06-04
*/
#ifndef COMPILEH
#define COMPILEH
#include <stddef.h>
#define array_size(x) (sizeof(x) / sizeof(*(x)))
#define swap32(_x) ((uint32)( \
((((uint32)(_x)) & 0x000000FF) << 24) | \
((((uint32)(_x)) & 0x0000FF00) << 8) | \
((((uint32)(_x)) & 0xFF000000) >> 24) | \
((((uint32)(_x)) & 0x00FF0000) >> 8)))
#define swap16(_x) ((uint16)( \
((((uint16)(_x)) & 0xFF00) >> 8) | \
((((uint16)(_x)) & 0x00FF) << 8)))
#define around(size, align) (((size) + (align) - 1) & (~((align) - 1)))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#include <platform.h>
#ifndef CONFIG_NO_STRING
# define _t(x) x
#else
# define _t(x) 0
#endif
#endif /* COMPILEH */