[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [PATCH v3 21/43] arm64: define the CALLEE_SAVED_REGISTERS



Hi,

On 16/04/18 07:32, Huang Shijie wrote:
In the arm64, the callee-saved registers are x19 ~ x29.

s/In the/On/.

I think it would be good to mention where that convention comes from as this is not very obvious for non-arm expert :). This convention is from AAPCS64 [1].


This patch also removes the macro for arm32.

Signed-off-by: Huang Shijie <shijie.huang@xxxxxxx>
---
  arch/arm/sched.c       | 4 +---
  include/arm/arm64/os.h | 3 +++
  2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/sched.c b/arch/arm/sched.c
index 8091566..d1af379 100644
--- a/arch/arm/sched.c
+++ b/arch/arm/sched.c
@@ -1,12 +1,10 @@
  #include <mini-os/sched.h>
  #include <mini-os/xmalloc.h>
  #include <mini-os/console.h>
+#include <mini-os/os.h>
void arm_start_thread(void); -/* The AAPCS requires the callee (e.g. __arch_switch_threads) to preserve r4-r11. */
-#define CALLEE_SAVED_REGISTERS 8
-
  /* Architecture specific setup of thread creation */
  struct thread* arch_create_thread(char *name, void (*function)(void *),
                                    void *data)
diff --git a/include/arm/arm64/os.h b/include/arm/arm64/os.h
index 3d4aada..89b4002 100644
--- a/include/arm/arm64/os.h
+++ b/include/arm/arm64/os.h
@@ -25,4 +25,7 @@ static inline void local_irq_enable(void)
      __asm__ __volatile__("mrs %0, daif":"=r"(x)::"memory"); \
  }
+/* The Callee-saved registers : x19 ~ x29 */

Same here, I would mention the AAPCS64. Also I quite like the comments that was existing for arm32. It gives some pointer to the reader where to look at. So I would say:

"The AAPCS64 requires the callee (e.g __arch_switch_threads) to preserve x19-x29.".

Cheers,

+#define CALLEE_SAVED_REGISTERS 11
+
  #endif


--
Julien Grall

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.