~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-security

« back to all changes in this revision

Viewing changes to mpi/m68k/mpih-add1.S

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
2
 
 *                        sum in a third limb vector.
3
 
 *
4
 
 *      Copyright (C) 1992, 1994,1996, 1998, 
5
 
 *                    2001 Free Software Foundation, Inc.
6
 
 *       
7
 
 * This file is part of GnuPG.
8
 
 *
9
 
 * GnuPG is free software; you can redistribute it and/or modify
10
 
 * it under the terms of the GNU General Public License as published by
11
 
 * the Free Software Foundation; either version 2 of the License, or
12
 
 * (at your option) any later version.
13
 
 *
14
 
 * GnuPG is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 * GNU General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public License
20
 
 * along with this program; if not, write to the Free Software
21
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22
 
 *
23
 
 * Note: This code is heavily based on the GNU MP Library.
24
 
 *       Actually it's the same code with only minor changes in the
25
 
 *       way the data is stored; this is to support the abstraction
26
 
 *       of an optional secure memory allocation which may be used
27
 
 *       to avoid revealing of sensitive data due to paging etc.
28
 
 *       The GNU MP Library itself is published under the LGPL;
29
 
 *       however I decided to publish this code under the plain GPL.
30
 
 */
31
 
 
32
 
 
33
 
#include "sysdep.h"
34
 
#include "asm-syntax.h"
35
 
 
36
 
 
37
 
/*******************
38
 
 *  mpi_limb_t
39
 
 *  mpihelp_add_n( mpi_ptr_t res_ptr,   (sp + 4)
40
 
 *                 mpi_ptr_t s1_ptr,    (sp + 8)
41
 
 *                 mpi_ptr_t s2_ptr,    (sp + 16)
42
 
 *                 mpi_size_t size)     (sp + 12)
43
 
 */
44
 
 
45
 
 
46
 
        TEXT
47
 
        ALIGN
48
 
        GLOBL   C_SYMBOL_NAME(mpihelp_add_n)
49
 
 
50
 
C_SYMBOL_NAME(mpihelp_add_n:)
51
 
PROLOG(mpihelp_add_n)
52
 
        /* Save used registers on the stack.  */
53
 
        movel   R(d2),MEM_PREDEC(sp)
54
 
        movel   R(a2),MEM_PREDEC(sp)
55
 
 
56
 
        /* Copy the arguments to registers.  Better use movem?  */
57
 
        movel   MEM_DISP(sp,12),R(a2)
58
 
        movel   MEM_DISP(sp,16),R(a0)
59
 
        movel   MEM_DISP(sp,20),R(a1)
60
 
        movel   MEM_DISP(sp,24),R(d2)
61
 
 
62
 
        eorw    #1,R(d2)
63
 
        lsrl    #1,R(d2)
64
 
        bcc     L(L1)
65
 
        subql   #1,R(d2)        /* clears cy as side effect */
66
 
 
67
 
L(Loop:)
68
 
        movel   MEM_POSTINC(a0),R(d0)
69
 
        movel   MEM_POSTINC(a1),R(d1)
70
 
        addxl   R(d1),R(d0)
71
 
        movel   R(d0),MEM_POSTINC(a2)
72
 
L(L1:)  movel   MEM_POSTINC(a0),R(d0)
73
 
        movel   MEM_POSTINC(a1),R(d1)
74
 
        addxl   R(d1),R(d0)
75
 
        movel   R(d0),MEM_POSTINC(a2)
76
 
 
77
 
        dbf     R(d2),L(Loop)           /* loop until 16 lsb of %4 == -1 */
78
 
        subxl   R(d0),R(d0)     /* d0 <= -cy; save cy as 0 or -1 in d0 */
79
 
        subl    #0x10000,R(d2)
80
 
        bcs     L(L2)
81
 
        addl    R(d0),R(d0)     /* restore cy */
82
 
        bra     L(Loop)
83
 
 
84
 
L(L2:)
85
 
        negl    R(d0)
86
 
 
87
 
        /* Restore used registers from stack frame.  */
88
 
        movel   MEM_POSTINC(sp),R(a2)
89
 
        movel   MEM_POSTINC(sp),R(d2)
90
 
 
91
 
        rts
92
 
EPILOG(mpihelp_add_n)
93
 
 
94