blob: 750d47b0161872ebc654652393cd3adb48351027 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __CONFIG_CORE_H
#define __CONFIG_CORE_H
/* Linker binary architecture and format */
#define BFD_ARCH nds32
#define BFD_FORMAT "elf32-nds32le"
/*
* The Andestar v3m architecture has no CLZ instruction (contrary to v3),
* so let's use the software implementation.
*/
#define CONFIG_SOFTWARE_CLZ
/*
* Force the compiler to use a proper relocation when accessing an external
* variable in a read-only section.
* TODO(crosbug.com/p/24378): remove me when the nds32 toolchain bug is fixed.
*/
#undef RO
#define RO(var) \
({ \
typeof(var) *__ptr_val; \
asm volatile("la %0, " #var "\n" : "=r"(__ptr_val)); \
((typeof(var))(*__ptr_val)); \
})
#endif /* __CONFIG_CORE_H */
|