blob: ab15d955eeaf310c14bbb9b38fe1d72a22a23bdc [file] [log] [blame]
Will Drewryde2cad72017-03-10 15:53:34 -06001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <stdint.h>
18#include <string.h>
19
Andrew Scullb270de22017-04-21 18:52:52 +010020#include <libkern/OSByteOrder.h>
21
Will Drewryde2cad72017-03-10 15:53:34 -060022void *ese_memcpy(void *__dest, const void *__src, uint64_t __n) {
23 return memcpy(__dest, __src, __n);
24}
25
26void *ese_memset(void *__s, int __c, uint64_t __n) {
27 return memset(__s, __c, __n);
28}
Andrew Scullb270de22017-04-21 18:52:52 +010029
30uint32_t ese_be32toh(uint32_t big_endian_32bits) {
31 return OSSwapBigToHostInt32(big_endian_32bits);
32}
33
34uint32_t ese_htobe32(uint32_t host_32bits) {
35 return OSSwapHostToBigInt32(host_32bits);
36}
37
38uint32_t ese_le32toh(uint32_t little_endian_32bits) {
39 return OSSwapLittleToHostInt32(little_endian_32bits);
40}
41
42uint32_t ese_htole32(uint32_t host_32bits) {
43 return OSSwapHostToLittleInt32(host_32bits);
44}