Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Abstract __attribute__((regparm)) into an 'asmcall' macro.

  • Loading branch information...
commit 20d768b833e518f1e5c5711c0853a49f0e6a683e 1 parent eb69575
Nelson Elhage authored

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 4 bt.cpp
9 bt.cpp
@@ -20,6 +20,8 @@ int modify_ldt(int func, struct user_desc *ptr, unsigned long bytes) {
20 20 #include <i386/user_ldt.h>
21 21 #endif
22 22
  23 +#define asmcall __attribute__((used, regparm(3)))
  24 +
23 25 #define BT_STACK_SIZE (1 << 16)
24 26
25 27 /* 1MB translation code cache */
@@ -45,7 +47,7 @@ extern "C" void bt_continue_chain(void);
45 47 extern "C" void bt_continue_ic(void);
46 48 extern "C" void bt_interrupt(void);
47 49
48   -extern "C" void bt_translate_and_run(beta_cpu *cpu, uint32_t used, ccbuff chainptr) __attribute__((noreturn, used, regparm(3)));
  50 +extern "C" void asmcall bt_translate_and_run(beta_cpu *cpu, uint32_t used, ccbuff chainptr) __attribute__((noreturn, used));
49 51 static ccbuff bt_translate_frag(compiled_frag *cfrag, decode_frag *frag);
50 52
51 53 /*
@@ -541,13 +543,12 @@ inline void bt_translate_prologue(X86Assembler *buf, byteptr pc) {
541 543 }
542 544
543 545 extern "C" {
544   - void bt_step_one(beta_cpu *cpu) __attribute__((used, regparm(1)));
  546 + void asmcall bt_step_one(beta_cpu *cpu);
545 547 void bt_step_one(beta_cpu *cpu) {
546 548 cpu->step_one();
547 549 }
548 550
549   - void bt_process_interrupt(beta_cpu *cpu) __attribute__((used, regparm(1)));
550   - void bt_process_interrupt(beta_cpu *cpu) {
  551 + void asmcall bt_process_interrupt(beta_cpu *cpu) {
551 552 cpu->process_interrupt();
552 553 }
553 554 };

0 comments on commit 20d768b

Please sign in to comment.
Something went wrong with that request. Please try again.