OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [bfd/] [libbfd.c] - Diff between revs 157 and 225

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 547... Line 547...
  (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
  (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
 
 
bfd_vma
bfd_vma
bfd_getb16 (const void *p)
bfd_getb16 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  return (addr[0] << 8) | addr[1];
  return (addr[0] << 8) | addr[1];
}
}
 
 
bfd_vma
bfd_vma
bfd_getl16 (const void *p)
bfd_getl16 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  return (addr[1] << 8) | addr[0];
  return (addr[1] << 8) | addr[0];
}
}
 
 
bfd_signed_vma
bfd_signed_vma
bfd_getb_signed_16 (const void *p)
bfd_getb_signed_16 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  return COERCE16 ((addr[0] << 8) | addr[1]);
  return COERCE16 ((addr[0] << 8) | addr[1]);
}
}
 
 
bfd_signed_vma
bfd_signed_vma
bfd_getl_signed_16 (const void *p)
bfd_getl_signed_16 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  return COERCE16 ((addr[1] << 8) | addr[0]);
  return COERCE16 ((addr[1] << 8) | addr[0]);
}
}
 
 
void
void
bfd_putb16 (bfd_vma data, void *p)
bfd_putb16 (bfd_vma data, void *p)
{
{
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[0] = (data >> 8) & 0xff;
  addr[0] = (data >> 8) & 0xff;
  addr[1] = data & 0xff;
  addr[1] = data & 0xff;
}
}
 
 
void
void
bfd_putl16 (bfd_vma data, void *p)
bfd_putl16 (bfd_vma data, void *p)
{
{
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[0] = data & 0xff;
  addr[0] = data & 0xff;
  addr[1] = (data >> 8) & 0xff;
  addr[1] = (data >> 8) & 0xff;
}
}
 
 
bfd_vma
bfd_vma
bfd_getb32 (const void *p)
bfd_getb32 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  unsigned long v;
  unsigned long v;
 
 
  v = (unsigned long) addr[0] << 24;
  v = (unsigned long) addr[0] << 24;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[2] << 8;
  v |= (unsigned long) addr[2] << 8;
Line 604... Line 604...
}
}
 
 
bfd_vma
bfd_vma
bfd_getl32 (const void *p)
bfd_getl32 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  unsigned long v;
  unsigned long v;
 
 
  v = (unsigned long) addr[0];
  v = (unsigned long) addr[0];
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[2] << 16;
  v |= (unsigned long) addr[2] << 16;
Line 617... Line 617...
}
}
 
 
bfd_signed_vma
bfd_signed_vma
bfd_getb_signed_32 (const void *p)
bfd_getb_signed_32 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  unsigned long v;
  unsigned long v;
 
 
  v = (unsigned long) addr[0] << 24;
  v = (unsigned long) addr[0] << 24;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[1] << 16;
  v |= (unsigned long) addr[2] << 8;
  v |= (unsigned long) addr[2] << 8;
Line 630... Line 630...
}
}
 
 
bfd_signed_vma
bfd_signed_vma
bfd_getl_signed_32 (const void *p)
bfd_getl_signed_32 (const void *p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  unsigned long v;
  unsigned long v;
 
 
  v = (unsigned long) addr[0];
  v = (unsigned long) addr[0];
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[1] << 8;
  v |= (unsigned long) addr[2] << 16;
  v |= (unsigned long) addr[2] << 16;
Line 644... Line 644...
 
 
bfd_uint64_t
bfd_uint64_t
bfd_getb64 (const void *p ATTRIBUTE_UNUSED)
bfd_getb64 (const void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  bfd_uint64_t v;
  bfd_uint64_t v;
 
 
  v  = addr[0]; v <<= 8;
  v  = addr[0]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[2]; v <<= 8;
Line 667... Line 667...
 
 
bfd_uint64_t
bfd_uint64_t
bfd_getl64 (const void *p ATTRIBUTE_UNUSED)
bfd_getl64 (const void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  bfd_uint64_t v;
  bfd_uint64_t v;
 
 
  v  = addr[7]; v <<= 8;
  v  = addr[7]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[5]; v <<= 8;
Line 691... Line 691...
 
 
bfd_int64_t
bfd_int64_t
bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED)
bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  bfd_uint64_t v;
  bfd_uint64_t v;
 
 
  v  = addr[0]; v <<= 8;
  v  = addr[0]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[1]; v <<= 8;
  v |= addr[2]; v <<= 8;
  v |= addr[2]; v <<= 8;
Line 714... Line 714...
 
 
bfd_int64_t
bfd_int64_t
bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED)
bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  bfd_uint64_t v;
  bfd_uint64_t v;
 
 
  v  = addr[7]; v <<= 8;
  v  = addr[7]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[6]; v <<= 8;
  v |= addr[5]; v <<= 8;
  v |= addr[5]; v <<= 8;
Line 736... Line 736...
}
}
 
 
void
void
bfd_putb32 (bfd_vma data, void *p)
bfd_putb32 (bfd_vma data, void *p)
{
{
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[0] = (data >> 24) & 0xff;
  addr[0] = (data >> 24) & 0xff;
  addr[1] = (data >> 16) & 0xff;
  addr[1] = (data >> 16) & 0xff;
  addr[2] = (data >>  8) & 0xff;
  addr[2] = (data >>  8) & 0xff;
  addr[3] = data & 0xff;
  addr[3] = data & 0xff;
}
}
 
 
void
void
bfd_putl32 (bfd_vma data, void *p)
bfd_putl32 (bfd_vma data, void *p)
{
{
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[0] = data & 0xff;
  addr[0] = data & 0xff;
  addr[1] = (data >>  8) & 0xff;
  addr[1] = (data >>  8) & 0xff;
  addr[2] = (data >> 16) & 0xff;
  addr[2] = (data >> 16) & 0xff;
  addr[3] = (data >> 24) & 0xff;
  addr[3] = (data >> 24) & 0xff;
}
}
 
 
void
void
bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[0] = (data >> (7*8)) & 0xff;
  addr[0] = (data >> (7*8)) & 0xff;
  addr[1] = (data >> (6*8)) & 0xff;
  addr[1] = (data >> (6*8)) & 0xff;
  addr[2] = (data >> (5*8)) & 0xff;
  addr[2] = (data >> (5*8)) & 0xff;
  addr[3] = (data >> (4*8)) & 0xff;
  addr[3] = (data >> (4*8)) & 0xff;
  addr[4] = (data >> (3*8)) & 0xff;
  addr[4] = (data >> (3*8)) & 0xff;
Line 775... Line 775...
 
 
void
void
bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
{
{
#ifdef BFD_HOST_64_BIT
#ifdef BFD_HOST_64_BIT
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  addr[7] = (data >> (7*8)) & 0xff;
  addr[7] = (data >> (7*8)) & 0xff;
  addr[6] = (data >> (6*8)) & 0xff;
  addr[6] = (data >> (6*8)) & 0xff;
  addr[5] = (data >> (5*8)) & 0xff;
  addr[5] = (data >> (5*8)) & 0xff;
  addr[4] = (data >> (4*8)) & 0xff;
  addr[4] = (data >> (4*8)) & 0xff;
  addr[3] = (data >> (3*8)) & 0xff;
  addr[3] = (data >> (3*8)) & 0xff;
Line 792... Line 792...
}
}
 
 
void
void
bfd_put_bits (bfd_uint64_t data, void *p, int bits, bfd_boolean big_p)
bfd_put_bits (bfd_uint64_t data, void *p, int bits, bfd_boolean big_p)
{
{
  bfd_byte *addr = p;
  bfd_byte *addr = (bfd_byte *) p;
  int i;
  int i;
  int bytes;
  int bytes;
 
 
  if (bits % 8 != 0)
  if (bits % 8 != 0)
    abort ();
    abort ();
Line 812... Line 812...
}
}
 
 
bfd_uint64_t
bfd_uint64_t
bfd_get_bits (const void *p, int bits, bfd_boolean big_p)
bfd_get_bits (const void *p, int bits, bfd_boolean big_p)
{
{
  const bfd_byte *addr = p;
  const bfd_byte *addr = (const bfd_byte *) p;
  bfd_uint64_t data;
  bfd_uint64_t data;
  int i;
  int i;
  int bytes;
  int bytes;
 
 
  if (bits % 8 != 0)
  if (bits % 8 != 0)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.