mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
Endian conversion: move to platform.h and platform/endian*.c
Starting to move the platform dependent code to platform/ and provide the abstraction through the platform.h header. Change-Id: I35640282d451960f2a329ae24339ec05dbae6d30 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/62899 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
6272c71fbb
commit
b1db7e4367
5
Makefile
5
Makefile
@ -378,7 +378,7 @@ CHIP_OBJS = jedec.o stm50.o w39.o w29ee011.o \
|
||||
# Library code.
|
||||
|
||||
LIB_OBJS = libflashrom.o layout.o flashrom.o udelay.o programmer.o programmer_table.o \
|
||||
helpers.o ich_descriptors.o fmap.o hwaccess_endian_$(ENDIAN).o
|
||||
helpers.o ich_descriptors.o fmap.o platform/endian_$(ENDIAN).o
|
||||
|
||||
|
||||
###############################################################################
|
||||
@ -977,7 +977,8 @@ strip: $(PROGRAM)$(EXEC_SUFFIX)
|
||||
# This includes all frontends and libflashrom.
|
||||
# We don't use EXEC_SUFFIX here because we want to clean everything.
|
||||
clean:
|
||||
rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a $(filter-out Makefile.d, $(wildcard *.d *.o)) $(PROGRAM).8 $(PROGRAM).8.html $(BUILD_DETAILS_FILE)
|
||||
rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a $(filter-out Makefile.d, $(wildcard *.d *.o platform/*.d platform/*.o)) \
|
||||
$(PROGRAM).8 $(PROGRAM).8.html $(BUILD_DETAILS_FILE)
|
||||
@+$(MAKE) -C util/ich_descriptors_tool/ clean
|
||||
|
||||
install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "flash.h"
|
||||
#include "hwaccess.h"
|
||||
#include "platform.h"
|
||||
#include "hwaccess_physmap.h"
|
||||
|
||||
#if !defined(__DJGPP__) && !defined(__LIBPAYLOAD__)
|
||||
|
@ -136,11 +136,11 @@ if cc.check_header('sys/utsname.h')
|
||||
endif
|
||||
|
||||
if host_machine.endian() == 'little'
|
||||
srcs += 'hwaccess_endian_little.c'
|
||||
srcs += 'platform/endian_little.c'
|
||||
add_project_arguments('-D__FLASHROM_LITTLE_ENDIAN__=1', language : 'c')
|
||||
endif
|
||||
if host_machine.endian() == 'big'
|
||||
srcs += 'hwaccess_endian_big.c'
|
||||
srcs += 'platform/endian_big.c'
|
||||
add_project_arguments('-D__FLASHROM_BIG_ENDIAN__=1', language : 'c')
|
||||
endif
|
||||
|
||||
|
@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Header file for hardware access and OS abstraction. Included from flash.h.
|
||||
* Header file for platform abstraction.
|
||||
*/
|
||||
|
||||
#ifndef __HWACCESS_H__
|
||||
#define __HWACCESS_H__ 1
|
||||
#ifndef __PLATFORM_H__
|
||||
#define __PLATFORM_H__ 1
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -100,4 +100,4 @@ uint16_t be_to_cpu16(const uint16_t value);
|
||||
uint32_t be_to_cpu32(const uint32_t value);
|
||||
uint64_t be_to_cpu64(const uint64_t value);
|
||||
|
||||
#endif /* !__HWACCESS_H__ */
|
||||
#endif /* !__PLATFORM_H__ */
|
@ -15,7 +15,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "hwaccess.h"
|
||||
#include "../platform.h"
|
||||
|
||||
/* convert cpu native endian to little endian */
|
||||
___return_swapped(cpu_to_le, 8)
|
@ -15,7 +15,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "hwaccess.h"
|
||||
#include "../platform.h"
|
||||
|
||||
/* convert cpu native endian to little endian */
|
||||
___return_same(cpu_to_le, 8)
|
Loading…
x
Reference in New Issue
Block a user