misc: respect standard __ASSEMBLER__ define in CPU headers

The JZ47xx and S5L87xx processor families used their own
special defines (__ASSEMBLY__ and ASM respectively) in
their CPU headers to check if they were included from an
assembly source file.

For GCC the standard seems to be __ASSEMBLER__, so check
for that instead and remove the non-standard symbols.
Being more consistent across platforms makes it easier to
include cpu.h from cross-platform files (eg. plugin.lds).

Change-Id: I282930cad34e1a2ff18166f3b4338548b34f4a49
This commit is contained in:
Aidan MacDonald 2026-03-05 19:59:03 +00:00
parent 5a236963e4
commit f44b6c78e0
15 changed files with 19 additions and 23 deletions

View file

@ -15,7 +15,7 @@
#ifndef __JZ4760B_H__
#define __JZ4760B_H__
#if defined(__ASSEMBLY__) || defined(__LANGUAGE_ASSEMBLY)
#if defined(__ASSEMBLER__)
#ifndef __MIPS_ASSEMBLER
#define __MIPS_ASSEMBLER
#endif

View file

@ -1,4 +1,4 @@
#define ASM
#define __ASSEMBLER__
#include "config.h"
#include "cpu.h"
#include "mks5lboot.h"

View file

@ -30,7 +30,7 @@
#define BIN_OFFSET (CERT_OFFSET + ((CERT_SIZE + 0x3) & ~ 0x3))
#define MAX_PAYLOAD (DFU_MAXSIZE - BIN_OFFSET)
#ifndef ASM
#ifndef __ASSEMBLER__
#include <stddef.h>
#include <stdint.h>
@ -124,6 +124,6 @@ void ipoddfu_debug(int debug);
#ifdef __cplusplus
};
#endif
#endif /* ASM */
#endif /* __ASSEMBLER__ */
#endif /* __MK6GBOOT_H__ */