public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: 64-bit support for srec
@ 2012-02-02  0:35 Joel Sherrill
  2012-02-02  1:57 ` Mike Stump
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Sherrill @ 2012-02-02  0:35 UTC (permalink / raw)
  To: Mike Stump, binutils

Lol.. who would have thought this day would come?

Can anything on the receiving end read these? 

--joel

Mike Stump <mikestump@comcast.net> wrote:

>So, I'm sure I will anger the gods, for I am a heretic, but, here is support for writing 64-bit srecs.
>
>Ok?
>

^ permalink raw reply	[flat|nested] 7+ messages in thread
* 64-bit support for srec
@ 2012-02-01 23:55 Mike Stump
  2012-02-02  3:23 ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Stump @ 2012-02-01 23:55 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

So, I'm sure I will anger the gods, for I am a heretic, but, here is support for writing 64-bit srecs.

Ok?


[-- Attachment #2: binutils-1.diffs.txt --]
[-- Type: text/plain, Size: 2549 bytes --]

2012-02-01  Mike Stump  <mikestump@comcast.net>

	* srec.c (srec_set_section_contents): Add 64-bit output support.
	(srec_write_record): Likewise.
	(srec_write_section): Likewise.	

Index: binutils/bfd/srec.c
===================================================================
*** binutils/bfd/srec.c	(revision 2070)
--- binutils/bfd/srec.c	(working copy)
*************** srec_set_section_contents (bfd *abfd,
*** 897,904 ****
        else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
  	       && tdata->type <= 2)
  	tdata->type = 2;
!       else
  	tdata->type = 3;
  
        entry->data = data;
        entry->where = section->lma + offset;
--- 897,907 ----
        else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
  	       && tdata->type <= 2)
  	tdata->type = 2;
!       else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffffff
! 	       && tdata->type <= 2)
  	tdata->type = 3;
+       else
+ 	tdata->type = 4;
  
        entry->data = data;
        entry->where = section->lma + offset;
*************** srec_write_record (bfd *abfd,
*** 956,961 ****
--- 959,973 ----
  
    switch (type)
      {
+     case 4:
+       TOHEX (dst, (address >> 56), check_sum);
+       dst += 2;
+       TOHEX (dst, (address >> 48), check_sum);
+       dst += 2;
+       TOHEX (dst, (address >> 40), check_sum);
+       dst += 2;
+       TOHEX (dst, (address >> 32), check_sum);
+       dst += 2;
      case 3:
      case 7:
        TOHEX (dst, (address >> 24), check_sum);
*************** srec_write_section (bfd *abfd,
*** 1019,1027 ****
    /* Validate number of data bytes to write.  The srec length byte
       counts the address, data and crc bytes.  S1 (tdata->type == 1)
       records have two address bytes, S2 (tdata->type == 2) records
!      have three, and S3 (tdata->type == 3) records have four.
!      The total length can't exceed 255, and a zero data length will
!      spin for a long time.  */
    if (Chunk == 0)
      Chunk = 1;
    else if (Chunk > MAXCHUNK - tdata->type - 2)
--- 1031,1039 ----
    /* Validate number of data bytes to write.  The srec length byte
       counts the address, data and crc bytes.  S1 (tdata->type == 1)
       records have two address bytes, S2 (tdata->type == 2) records
!      have three, S3 (tdata->type == 3) records have four and S4
!      (tdata->type == 4) records have eight.  The total length can't
!      exceed 255, and a zero data length will spin for a long time.  */
    if (Chunk == 0)
      Chunk = 1;
    else if (Chunk > MAXCHUNK - tdata->type - 2)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-02-03  1:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-02  0:35 64-bit support for srec Joel Sherrill
2012-02-02  1:57 ` Mike Stump
  -- strict thread matches above, loose matches on Subject: below --
2012-02-01 23:55 Mike Stump
2012-02-02  3:23 ` Alan Modra
2012-02-03  0:37   ` Mike Stump
2012-02-03  1:35     ` Alan Modra
2012-02-03  1:40       ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).