blob: 5d65500dc5f5ba650d3f55683c046f2387925e78 [file] [log] [blame]
Thomas Heijligen5618d5b2022-02-19 21:17:44 +01001/*
2 * This file is part of the flashrom project.
3 *
4 * Copyright (C) 2022 secunet Security Networks AG
5 * (written by Thomas Heijligen <thomas.heijligen@secunet.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
Thomas Heijligenc92f94b2022-03-17 13:41:17 +010018#include "../platform.h"
Thomas Heijligen5618d5b2022-02-19 21:17:44 +010019
20/* convert cpu native endian to little endian */
21___return_swapped(cpu_to_le, 8)
22___return_swapped(cpu_to_le, 16)
23___return_swapped(cpu_to_le, 32)
24___return_swapped(cpu_to_le, 64)
25
26/* convert cpu native endian to big endian */
27___return_same(cpu_to_be, 8)
28___return_same(cpu_to_be, 16)
29___return_same(cpu_to_be, 32)
30___return_same(cpu_to_be, 64)
31
32/* convert little endian to cpu native endian */
33___return_swapped(le_to_cpu, 8)
34___return_swapped(le_to_cpu, 16)
35___return_swapped(le_to_cpu, 32)
36___return_swapped(le_to_cpu, 64)
37
38/* convert big endian to cpu native endian */
39___return_same(be_to_cpu, 8)
40___return_same(be_to_cpu, 16)
41___return_same(be_to_cpu, 32)
42___return_same(be_to_cpu, 64)