blob: 569b67d64d5c99c008e2adff64e0708b64d59d29 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
4 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
5 * The Silver Hammer Group, Ltd.
6 *
7 * This file provides the definitions and structures needed to
8 * support uClinux flat-format executables.
9 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#ifndef _LINUX_FLAT_H
11#define _LINUX_FLAT_H
12
David Howells607ca462012-10-13 10:46:48 +010013#include <uapi/linux/flat.h>
Al Viro468138d2017-05-02 19:52:17 -040014#include <asm/flat.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Linus Torvalds1da177e2005-04-16 15:20:36 -070016/*
17 * While it would be nice to keep this header clean, users of older
18 * tools still need this support in the kernel. So this section is
19 * purely for compatibility with old tool chains.
20 *
21 * DO NOT make changes or enhancements to the old format please, just work
22 * with the format above, except to fix bugs with old format support.
23 */
24
25#include <asm/byteorder.h>
26
27#define OLD_FLAT_VERSION 0x00000002L
28#define OLD_FLAT_RELOC_TYPE_TEXT 0
29#define OLD_FLAT_RELOC_TYPE_DATA 1
30#define OLD_FLAT_RELOC_TYPE_BSS 2
31
32typedef union {
33 unsigned long value;
34 struct {
35# if defined(mc68000) && !defined(CONFIG_COLDFIRE)
36 signed long offset : 30;
37 unsigned long type : 2;
38# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
39# elif defined(__BIG_ENDIAN_BITFIELD)
40 unsigned long type : 2;
41 signed long offset : 30;
42# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
43# elif defined(__LITTLE_ENDIAN_BITFIELD)
44 signed long offset : 30;
45 unsigned long type : 2;
46# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
47# else
48# error "Unknown bitfield order for flat files."
49# endif
50 } reloc;
51} flat_v2_reloc_t;
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif /* _LINUX_FLAT_H */