diff options
| author | Dina K Nimeh <Dina.Nimeh@Sun.COM> | 2010-08-10 20:08:22 -0700 | 
|---|---|---|
| committer | Dina K Nimeh <Dina.Nimeh@Sun.COM> | 2010-08-10 20:08:22 -0700 | 
| commit | f2ba9e96867935dc624ece52573c174612f72825 (patch) | |
| tree | 22f14d99e5a2de5403715f806597256bf5b1b624 /usr/src/common/mpi | |
| parent | e8315de7ff803feff73210777ffff75896d69f30 (diff) | |
| download | illumos-joyent-f2ba9e96867935dc624ece52573c174612f72825.tar.gz | |
6948791 Panics are seen when running EF on sparc in b139 caused by mp_int having flag=0xbaddcafe
Diffstat (limited to 'usr/src/common/mpi')
| -rw-r--r-- | usr/src/common/mpi/mpi.c | 15 | ||||
| -rw-r--r-- | usr/src/common/mpi/mpi.h | 9 | 
2 files changed, 10 insertions, 14 deletions
| diff --git a/usr/src/common/mpi/mpi.c b/usr/src/common/mpi/mpi.c index b16c711e34..6241dac0a9 100644 --- a/usr/src/common/mpi/mpi.c +++ b/usr/src/common/mpi/mpi.c @@ -1,3 +1,4 @@ +/* BEGIN CSTYLED */  /*   *  mpi.c   * @@ -41,14 +42,11 @@   *   * ***** END LICENSE BLOCK ***** */  /* - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.   *   * Sun elects to use this software under the MPL license.   */ -#pragma ident	"%Z%%M%	%I%	%E% SMI" -  /* $Id: mpi.c,v 1.45 2006/09/29 20:12:21 alexei.volkov.bugs%sun.com Exp $ */  #include "mpi-priv.h" @@ -160,6 +158,7 @@ mp_err mp_init_size(mp_int *mp, mp_size prec, int kmflag)    SIGN(mp) = ZPOS;    USED(mp) = 1;    ALLOC(mp) = prec; +  FLAG(mp) = kmflag;    return MP_OKAY; @@ -251,6 +250,7 @@ mp_err mp_copy(const mp_int *from, mp_int *to)      /* Copy the precision and sign from the original */      USED(to) = USED(from);      SIGN(to) = SIGN(from); +    FLAG(to) = FLAG(from);    } /* end copy */    return MP_OKAY; @@ -2886,13 +2886,9 @@ void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count)  /* Allocate ni records of nb bytes each, and return a pointer to that     */  void    *s_mp_alloc(size_t nb, size_t ni, int kmflag)  { -  mp_int *mp;    ++mp_allocs;  #ifdef _KERNEL -  mp = kmem_zalloc(nb * ni, kmflag); -  if (mp != NULL) -    FLAG(mp) = kmflag; -  return (mp); +  return kmem_zalloc(nb * ni, kmflag);  #else    return calloc(nb, ni);  #endif @@ -4870,3 +4866,4 @@ mp_to_fixlen_octets(const mp_int *mp, unsigned char *str, mp_size length)  /*------------------------------------------------------------------------*/  /* HERE THERE BE DRAGONS                                                  */ +/* END CSTYLED */ diff --git a/usr/src/common/mpi/mpi.h b/usr/src/common/mpi/mpi.h index c5384df1c1..79a18a018f 100644 --- a/usr/src/common/mpi/mpi.h +++ b/usr/src/common/mpi/mpi.h @@ -1,3 +1,4 @@ +/* BEGIN CSTYLED */  /*   *  mpi.h   * @@ -40,8 +41,7 @@   *   * ***** END LICENSE BLOCK ***** */  /* - * Copyright 2007 Sun Microsystems, Inc.  All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.   *   * Sun elects to use this software under the MPL license.   */ @@ -49,8 +49,6 @@  #ifndef _MPI_H  #define _MPI_H -#pragma ident	"%Z%%M%	%I%	%E% SMI" -  /* $Id: mpi.h,v 1.22 2004/04/27 23:04:36 gerv%gerv.net Exp $ */  #include "mpi-config.h" @@ -240,7 +238,7 @@ typedef          int      mp_sword;  #define MP_MAX_RADIX         64  typedef struct { -  mp_sign       flag;    /* KM_SLEEP/KM_NOSLEEP        */ +  mp_flag       flag;    /* KM_SLEEP/KM_NOSLEEP        */    mp_sign       sign;    /* sign of this quantity      */    mp_size       alloc;   /* how many digits allocated  */    mp_size       used;    /* how many digits used       */ @@ -392,3 +390,4 @@ mp_size mp_trailing_zeros(const mp_int *mp);  #endif /* defined MP_API_COMPATIBLE */  #endif /* _MPI_H */ +/* END CSTYLED */ | 
