Skip to content

Commit ebde3c6

Browse files
committed
py: Add guarded includes for asm-based headers.
1 parent ddbcc79 commit ebde3c6

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

py/asmarm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
* THE SOFTWARE.
2626
*/
27+
#ifndef __MICROPY_INCLUDED_PY_ASMARM_H__
28+
#define __MICROPY_INCLUDED_PY_ASMARM_H__
29+
30+
#include "py/misc.h"
2731

2832
#define ASM_ARM_PASS_COMPUTE (1)
2933
#define ASM_ARM_PASS_EMIT (2)
@@ -120,3 +124,4 @@ void asm_arm_bcc_label(asm_arm_t *as, int cond, uint label);
120124
void asm_arm_b_label(asm_arm_t *as, uint label);
121125
void asm_arm_bl_ind(asm_arm_t *as, void *fun_ptr, uint fun_id, uint reg_temp);
122126

127+
#endif // __MICROPY_INCLUDED_PY_ASMARM_H__

py/asmthumb.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26+
#ifndef __MICROPY_INCLUDED_PY_ASMTHUMB_H__
27+
#define __MICROPY_INCLUDED_PY_ASMTHUMB_H__
28+
29+
#include "py/misc.h"
2630

2731
#define ASM_THUMB_PASS_COMPUTE (1)
2832
#define ASM_THUMB_PASS_EMIT (2)
@@ -200,3 +204,5 @@ void asm_thumb_mov_reg_local_addr(asm_thumb_t *as, uint rlo_dest, int local_num)
200204
void asm_thumb_b_label(asm_thumb_t *as, uint label); // convenience ?
201205
void asm_thumb_bcc_label(asm_thumb_t *as, int cc, uint label); // convenience: picks narrow or wide branch
202206
void asm_thumb_bl_ind(asm_thumb_t *as, void *fun_ptr, uint fun_id, uint reg_temp); // convenience ?
207+
208+
#endif // __MICROPY_INCLUDED_PY_ASMTHUMB_H__

py/asmx64.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26+
#ifndef __MICROPY_INCLUDED_PY_ASMX64_H__
27+
#define __MICROPY_INCLUDED_PY_ASMX64_H__
28+
29+
#include "py/mpconfig.h"
30+
#include "py/misc.h"
2631

2732
// AMD64 calling convention is:
2833
// - args pass in: RDI, RSI, RDX, RCX, R08, R09
@@ -108,3 +113,5 @@ void asm_x64_mov_local_to_r64(asm_x64_t* as, int src_local_num, int dest_r64);
108113
void asm_x64_mov_r64_to_local(asm_x64_t* as, int src_r64, int dest_local_num);
109114
void asm_x64_mov_local_addr_to_r64(asm_x64_t* as, int local_num, int dest_r64);
110115
void asm_x64_call_ind(asm_x64_t* as, void* ptr, int temp_r32);
116+
117+
#endif // __MICROPY_INCLUDED_PY_ASMX64_H__

py/asmx86.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26+
#ifndef __MICROPY_INCLUDED_PY_ASMX86_H__
27+
#define __MICROPY_INCLUDED_PY_ASMX86_H__
28+
29+
#include "py/mpconfig.h"
30+
#include "py/misc.h"
2631

2732
// x86 cdecl calling convention is:
2833
// - args passed on the stack in reverse order
@@ -106,3 +111,5 @@ void asm_x86_mov_local_to_r32(asm_x86_t* as, int src_local_num, int dest_r32);
106111
void asm_x86_mov_r32_to_local(asm_x86_t* as, int src_r32, int dest_local_num);
107112
void asm_x86_mov_local_addr_to_r32(asm_x86_t* as, int local_num, int dest_r32);
108113
void asm_x86_call_ind(asm_x86_t* as, void* ptr, mp_uint_t n_args, int temp_r32);
114+
115+
#endif // __MICROPY_INCLUDED_PY_ASMX86_H__

0 commit comments

Comments
 (0)