From: Mamone Tarsha Date: Sun, 27 Jun 2021 14:16:56 +0000 (+0300) Subject: [S390x] Implement alloc_stack and free_stack macros in machine.m4 X-Git-Tag: nettle_3.8_release_20220602~112^2~4^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0525367c2dedbef9ebd9bf0a35a3cc3181cf7c6;p=thirdparty%2Fnettle.git [S390x] Implement alloc_stack and free_stack macros in machine.m4 --- diff --git a/s390x/machine.m4 b/s390x/machine.m4 index acd5e26c..b10b3045 100644 --- a/s390x/machine.m4 +++ b/s390x/machine.m4 @@ -1,2 +1,20 @@ C Register usage: define(`RA', `%r14') +define(`SP', `%r15') + +define(`STANDARD_STACK_FRAME',`160') + +C Dynamic stack space allocation +C the allocated space is assigned to 'AP' general register +C the length of space must be a multiple of 8 +C free_stack can be used to free the allocated space +C alloc_stack(AP, space_len) +define(`alloc_stack', +`lgr $1,SP + aghi SP,-(STANDARD_STACK_FRAME+$2) + stg $1,0(SP) + la $1,STANDARD_STACK_FRAME (SP)') + +C free_stack(space_len) +define(`free_stack', +`aghi SP,STANDARD_STACK_FRAME+$1')