From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27850 invoked by alias); 22 Jul 2014 09:36:45 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 27839 invoked by uid 89); 22 Jul 2014 09:36:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp10.uk.ibm.com Received: from e06smtp10.uk.ibm.com (HELO e06smtp10.uk.ibm.com) (195.75.94.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 22 Jul 2014 09:36:42 +0000 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Jul 2014 10:36:39 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 22 Jul 2014 10:36:37 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id F3D28219004D for ; Tue, 22 Jul 2014 10:36:21 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s6M9aaHI23003214 for ; Tue, 22 Jul 2014 09:36:36 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s6M9aaCM016683 for ; Tue, 22 Jul 2014 03:36:36 -0600 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-179.boeblingen.de.ibm.com [9.152.212.179]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s6M9aZTn016674 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jul 2014 03:36:35 -0600 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1X9WUt-0007u4-AF; Tue, 22 Jul 2014 11:36:35 +0200 Date: Tue, 22 Jul 2014 09:36:00 -0000 From: Dominik Vogt To: libffi-discuss@sourceware.org Subject: [RFC][PATCH 3/3] Complex type support (FFI_TYPE_COMPLEX) Message-ID: <20140722093635.GC30068@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com References: <20140722092734.GA23937@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Qbvjkv9qwOGw/5Fx" Content-Disposition: inline In-Reply-To: <20140722092734.GA23937@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14072209-4966-0000-0000-000000CB22E3 X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00074.txt.bz2 --Qbvjkv9qwOGw/5Fx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 388 ChangeLog: -- 2014-07-22 Dominik Vogt * src/s390/ffitarget.h (FFI_TARGET_HAS_COMPLEX_TYPE): Define to provide FFI_TYPE_COMPLEX support. * src/s390/ffi.c (ffi_check_struct_type): Implement FFI_TYPE_COMPLEX (ffi_prep_args): Ditto. (ffi_prep_cif_machdep): Ditto. (ffi_closure_helper_SYSV): Ditto. -- Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany --Qbvjkv9qwOGw/5Fx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-S390-Implement-FFI_TYPE_COMPLEX.patch" Content-length: 3004 >From 2fce72b95c240c35248df92e541d8596369ece53 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Tue, 22 Jul 2014 10:04:41 +0100 Subject: [PATCH 3/3] S390: Implement FFI_TYPE_COMPLEX --- src/s390/ffi.c | 25 ++++++++++++++++++------- src/s390/ffitarget.h | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/s390/ffi.c b/src/s390/ffi.c index 8adb5bc..520ec7c 100644 --- a/src/s390/ffi.c +++ b/src/s390/ffi.c @@ -215,9 +215,12 @@ ffi_prep_args (unsigned char *stack, extended_cif *ecif) #endif /* Check how a structure type is passed. */ - if (type == FFI_TYPE_STRUCT) + if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) { - type = ffi_check_struct_type (*ptr); + if (type == FFI_TYPE_COMPLEX) + type = FFI_TYPE_POINTER; + else + type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, copy the data. */ if (type == FFI_TYPE_POINTER) @@ -356,8 +359,9 @@ ffi_prep_cif_machdep(ffi_cif *cif) cif->flags = FFI390_RET_VOID; break; - /* Structures are returned via a hidden pointer. */ + /* Structures and complex are returned via a hidden pointer. */ case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: cif->flags = FFI390_RET_STRUCT; n_gpr++; /* We need one GPR to pass the pointer. */ break; @@ -420,9 +424,12 @@ ffi_prep_cif_machdep(ffi_cif *cif) #endif /* Check how a structure type is passed. */ - if (type == FFI_TYPE_STRUCT) + if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) { - type = ffi_check_struct_type (*ptr); + if (type == FFI_TYPE_COMPLEX) + type = FFI_TYPE_POINTER; + else + type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, we must reserve space to copy its data for proper call-by-value semantics. */ @@ -588,9 +595,12 @@ ffi_closure_helper_SYSV (ffi_closure *closure, #endif /* Check how a structure type is passed. */ - if (type == FFI_TYPE_STRUCT) + if (type == FFI_TYPE_STRUCT || type == FFI_TYPE_COMPLEX) { - type = ffi_check_struct_type (*ptr); + if (type == FFI_TYPE_COMPLEX) + type = FFI_TYPE_POINTER; + else + type = ffi_check_struct_type (*ptr); /* If we pass the struct via pointer, remember to retrieve the pointer later. */ @@ -687,6 +697,7 @@ ffi_closure_helper_SYSV (ffi_closure *closure, /* Void is easy, and so is struct. */ case FFI_TYPE_VOID: case FFI_TYPE_STRUCT: + case FFI_TYPE_COMPLEX: #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE case FFI_TYPE_LONGDOUBLE: #endif diff --git a/src/s390/ffitarget.h b/src/s390/ffitarget.h index 7700f26..0e4868a 100644 --- a/src/s390/ffitarget.h +++ b/src/s390/ffitarget.h @@ -53,6 +53,7 @@ typedef enum ffi_abi { #endif #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +#define FFI_TARGET_HAS_COMPLEX_TYPE /* ---- Definitions for closures ----------------------------------------- */ -- 1.8.4.2 --Qbvjkv9qwOGw/5Fx--