[ctypes-commit] ctypes/source/libffi/src/sh ffi.c,1.1.2.1,1.1.2.2 sysv.S,1.1.2.1,1.1.2.2
Brought to you by:
theller
From: Hye-Shik C. <pe...@us...> - 2006-02-01 20:32:03
|
Update of /cvsroot/ctypes/ctypes/source/libffi/src/sh In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9598/source/libffi/src/sh Modified Files: Tag: branch_1_0 ffi.c sysv.S Log Message: Update libffi to gcc head as of 2006/02/01. This fixes several unittest failures on 64bit platforms. Index: sysv.S =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/libffi/src/sh/Attic/sysv.S,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** sysv.S 31 Jan 2006 19:44:37 -0000 1.1.2.1 --- sysv.S 1 Feb 2006 20:31:52 -0000 1.1.2.2 *************** *** 402,405 **** --- 402,408 ---- L_pass_i: + cmp/eq #FFI_TYPE_INT,r0 + bf L_call_it + mov #8,r0 cmp/hs r0,r2 *************** *** 493,504 **** ENTRY(ffi_closure_SYSV) .LFB2: ! mov.l r14,@-r15 .LCFI7: sts.l pr,@-r15 /* Stack layout: ! ... ! 32 bytes (floating register parameters, SH-4 only) 16 bytes (register parameters) 8 bytes (result) 4 bytes (pad) --- 496,517 ---- ENTRY(ffi_closure_SYSV) .LFB2: ! mov.l r7,@-r15 .LCFI7: + mov.l r6,@-r15 + .LCFI8: + mov.l r5,@-r15 + .LCFI9: + mov.l r4,@-r15 + .LCFIA: + mov.l r14,@-r15 + .LCFIB: sts.l pr,@-r15 /* Stack layout: ! xx bytes (on stack parameters) 16 bytes (register parameters) + 4 bytes (saved frame pointer) + 4 bytes (saved return address) + 32 bytes (floating register parameters, SH-4 only) 8 bytes (result) 4 bytes (pad) *************** *** 506,529 **** <- new stack pointer */ ! .LCFI8: #if defined(__SH4__) ! add #-64,r15 #else ! add #-32,r15 #endif ! .LCFI9: mov r15,r14 ! .LCFIA: ! mov r14,r1 ! add #32,r1 ! mov.l r7,@-r1 ! mov.l r6,@-r1 ! mov.l r5,@-r1 ! mov.l r4,@-r1 ! mov r1,r6 #if defined(__SH4__) mov r14,r1 ! add #64,r1 #ifdef __LITTLE_ENDIAN__ fmov.s fr10,@-r1 --- 519,535 ---- <- new stack pointer */ ! .LCFIC: #if defined(__SH4__) ! add #-48,r15 #else ! add #-16,r15 #endif ! .LCFID: mov r15,r14 ! .LCFIE: #if defined(__SH4__) mov r14,r1 ! add #48,r1 #ifdef __LITTLE_ENDIAN__ fmov.s fr10,@-r1 *************** *** 546,549 **** --- 552,560 ---- #endif mov r1,r7 + mov r14,r6 + add #56,r6 + #else + mov r14,r6 + add #24,r6 #endif *************** *** 679,689 **** L_case_v: #if defined(__SH4__) ! add #64,r15 #else ! add #32,r15 #endif lds.l @r15+,pr rts ! mov.l @r15+,r14 .LFE2: .ffi_closure_SYSV_end: --- 690,701 ---- L_case_v: #if defined(__SH4__) ! add #48,r15 #else ! add #16,r15 #endif lds.l @r15+,pr + mov.l @r15+,r14 rts ! add #16,r15 .LFE2: .ffi_closure_SYSV_end: *************** *** 789,807 **** .4byte .LCFI8-.LCFI7 .byte 0xe /* DW_CFA_def_cfa_offset */ ! .byte 0x8 /* uleb128 0x8 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI9-.LCFI8 .byte 0xe /* DW_CFA_def_cfa_offset */ #if defined(__SH4__) ! .byte 8+64 /* uleb128 8+64 */ #else ! .byte 8+32 /* uleb128 8+32 */ #endif .byte 0x91 /* DW_CFA_offset, column 0x11 */ ! .byte 0x2 ! .byte 0x8e /* DW_CFA_offset, column 0xe */ ! .byte 0x1 .byte 0x4 /* DW_CFA_advance_loc4 */ ! .4byte .LCFIA-.LCFI9 .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0xe /* uleb128 0xe */ --- 801,843 ---- .4byte .LCFI8-.LCFI7 .byte 0xe /* DW_CFA_def_cfa_offset */ ! .byte 0x8 /* uleb128 0x4 */ .byte 0x4 /* DW_CFA_advance_loc4 */ .4byte .LCFI9-.LCFI8 .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0xc /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIA-.LCFI9 + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x10 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIB-.LCFIA + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x14 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFIC-.LCFIB + .byte 0xe /* DW_CFA_def_cfa_offset */ + .byte 0x18 /* uleb128 0x4 */ + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte .LCFID-.LCFIC + .byte 0xe /* DW_CFA_def_cfa_offset */ #if defined(__SH4__) ! .byte 24+48 /* uleb128 24+48 */ #else ! .byte 24+16 /* uleb128 24+16 */ #endif .byte 0x91 /* DW_CFA_offset, column 0x11 */ ! .byte 0x6 /* uleb128 0x6 */ ! .byte 0x8e /* DW_CFA_offset, column 0xe */ ! .byte 0x5 /* uleb128 0x5 */ ! .byte 0x8b /* DW_CFA_offset, column 0xb */ ! .byte 0x4 /* uleb128 0x4 */ ! .byte 0x8a /* DW_CFA_offset, column 0xa */ ! .byte 0x3 /* uleb128 0x3 */ ! .byte 0x89 /* DW_CFA_offset, column 0x9 */ ! .byte 0x2 /* uleb128 0x2 */ ! .byte 0x88 /* DW_CFA_offset, column 0x8 */ ! .byte 0x1 /* uleb128 0x1 */ .byte 0x4 /* DW_CFA_advance_loc4 */ ! .4byte .LCFIE-.LCFID .byte 0xd /* DW_CFA_def_cfa_register */ .byte 0xe /* uleb128 0xe */ Index: ffi.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/libffi/src/sh/Attic/ffi.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** ffi.c 31 Jan 2006 19:44:37 -0000 1.1.2.1 --- ffi.c 1 Feb 2006 20:31:52 -0000 1.1.2.2 *************** *** 1,4 **** /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 2002, 2003, 2004 Kaz Kojima SuperH Foreign Function Interface --- 1,4 ---- /* ----------------------------------------------------------------------- ! ffi.c - Copyright (c) 2002, 2003, 2004, 2005 Kaz Kojima SuperH Foreign Function Interface *************** *** 211,223 **** if (greg + n - 1 >= NGREGARG) continue; - greg += n; #else if (greg >= NGREGARG) continue; - else if (greg + n - 1 >= NGREGARG) - greg = NGREGARG; - else - greg += n; #endif memcpy (argp, *p_argv, z); argp += n * sizeof (int); --- 211,219 ---- if (greg + n - 1 >= NGREGARG) continue; #else if (greg >= NGREGARG) continue; #endif + greg += n; memcpy (argp, *p_argv, z); argp += n * sizeof (int); *************** *** 381,387 **** continue; else if (greg + n - 1 >= NGREGARG) ! greg = NGREGARG; ! else ! greg += n; for (m = 0; m < n; m++) cif->flags += FFI_TYPE_INT << (2 * j++); --- 377,382 ---- continue; else if (greg + n - 1 >= NGREGARG) ! n = NGREGARG - greg; ! greg += n; for (m = 0; m < n; m++) cif->flags += FFI_TYPE_INT << (2 * j++); *************** *** 428,431 **** --- 423,427 ---- { extended_cif ecif; + UINT64 trvalue; ecif.cif = cif; *************** *** 435,439 **** /* value address then we need to make one */ ! if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { --- 431,438 ---- /* value address then we need to make one */ ! if (cif->rtype->type == FFI_TYPE_STRUCT ! && return_type (cif->rtype) != FFI_TYPE_STRUCT) ! ecif.rvalue = &trvalue; ! else if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { *************** *** 444,448 **** else ecif.rvalue = rvalue; - switch (cif->abi) --- 443,446 ---- *************** *** 458,461 **** --- 456,464 ---- break; } + + if (rvalue + && cif->rtype->type == FFI_TYPE_STRUCT + && return_type (cif->rtype) != FFI_TYPE_STRUCT) + memcpy (rvalue, &trvalue, cif->rtype->size); } *************** *** 621,633 **** if (greg + n - 1 >= NGREGARG) continue; - greg += n; #else if (greg >= NGREGARG) continue; - else if (greg + n - 1 >= NGREGARG) - greg = NGREGARG; - else - greg += n; #endif avalue[i] = pgr; pgr += n; --- 624,632 ---- if (greg + n - 1 >= NGREGARG) continue; #else if (greg >= NGREGARG) continue; #endif + greg += n; avalue[i] = pgr; pgr += n; *************** *** 713,717 **** else if (greg < NGREGARG) { ! greg = NGREGARG; continue; } --- 712,717 ---- else if (greg < NGREGARG) { ! greg += n; ! pst += greg - NGREGARG; continue; } |