public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Inderpreet Singh Baweja" <Inderpreet.Baweja@noida.hcltech.com>
To: "Nick Clifton" <nickc@redhat.com>
Cc: <binutils@sources.redhat.com>,
	"Naveen Sharma, Noida" <naveen.sharma@noida.hcltech.com>
Subject: RE: [PATCH]: binutils patch for maxq target.
Date: Thu, 06 Jan 2005 09:58:00 -0000	[thread overview]
Message-ID: <33BC33A9E76474479B76AD0DE8A16972015C97@exch-ntd.nec.noida.hcltech.com> (raw)

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

Hi Nick,

Thanks for reviewing my patch and I do appreciate you for pointing
Out my mistakes. Thanks for that.

Here I have separated down individual patches this will be the 
first of the series.

This patch will enable the maxq target to
differentiate between machine types( MAXQ10 and MAXQ20 ).


----------- Change Log ---------------------------------

2004-12-28	Inderpreet Singh <inderpreetb@noida.hcltech.com>

bfd/

	* archures.c: define bfd_mach_maxq10 and bfd_mach_maxq20.
	* bfd-in2.h:  Likewise.
	* coffcode.h: Likewise.
	* cpu-maxq.c: arch_info_type defined for maxq10 and maxq20.

gas/config
	* tc-maxq.c (md_pseudo_table): added new pseudo ops for maxq10 
	and maxq20.
	(maxq_target): added function to set the arch. type.
--------------------------------------------------------------


Thanks,
Inder


[-- Attachment #2: patch-06012005 --]
[-- Type: application/octet-stream, Size: 10179 bytes --]

Index: bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.100
diff -c -3 -p -r1.100 archures.c
*** bfd/archures.c	9 Dec 2004 06:08:45 -0000	1.100
--- bfd/archures.c	6 Jan 2005 09:38:58 -0000
*************** DESCRIPTION
*** 356,361 ****
--- 356,363 ----
  .  bfd_arch_xtensa,    {* Tensilica's Xtensa cores.  *}
  .#define bfd_mach_xtensa	1
  .   bfd_arch_maxq,     {* Dallas MAXQ 10/20 *}
+ .#define bfd_mach_maxq10    10
+ .#define bfd_mach_maxq20    20
  .  bfd_arch_last
  .  };
  */
Index: bfd/bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.312
diff -c -3 -p -r1.312 bfd-in2.h
*** bfd/bfd-in2.h	31 Dec 2004 00:43:58 -0000	1.312
--- bfd/bfd-in2.h	6 Jan 2005 09:39:01 -0000
*************** enum bfd_architecture
*** 1807,1812 ****
--- 1807,1814 ----
    bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
  #define bfd_mach_xtensa        1
     bfd_arch_maxq,     /* Dallas MAXQ 10/20 */
+ #define bfd_mach_maxq10    10
+ #define bfd_mach_maxq20    20
    bfd_arch_last
    };
  
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.114
diff -c -3 -p -r1.114 coffcode.h
*** bfd/coffcode.h	8 Nov 2004 13:17:32 -0000	1.114
--- bfd/coffcode.h	6 Jan 2005 09:39:07 -0000
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1987,1995 ****
        break;
  #endif
  #ifdef MAXQ20MAGIC
!     case MAXQ20MAGIC:
        arch = bfd_arch_maxq;
!       machine = 0;
        break;
  #endif
  #ifdef MC88MAGIC
--- 1987,2005 ----
        break;
  #endif
  #ifdef MAXQ20MAGIC
! 	 case MAXQ20MAGIC:
        arch = bfd_arch_maxq;
!       switch (internal_f->f_flags & F_MACHMASK)
!        { 
!         case F_MAXQ10:
!           machine = bfd_mach_maxq10;
!           break;
!         case F_MAXQ20:
!           machine = bfd_mach_maxq20;
!           break;
!         default:
!           return FALSE;
!        }
        break;
  #endif
  #ifdef MC88MAGIC
*************** coff_set_flags (abfd, magicp, flagsp)
*** 2926,2933 ****
  #endif
  
  #ifdef MAXQ20MAGIC
!     case bfd_arch_maxq:
!         *magicp = MAXQ20MAGIC;
        return TRUE;
        break;
  #endif
--- 2936,2954 ----
  #endif
  
  #ifdef MAXQ20MAGIC
! 		case bfd_arch_maxq:
!       *magicp = MAXQ20MAGIC;
!       switch (bfd_get_mach (abfd))
!        {
!         case bfd_mach_maxq10:
!          *flagsp = F_MAXQ10;
!          break;
!         case bfd_mach_maxq20:
!          *flagsp=F_MAXQ20;
!          break;
!         default:
!          return FALSE;
!        }
        return TRUE;
        break;
  #endif
Index: bfd/cpu-maxq.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-maxq.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 cpu-maxq.c
*** bfd/cpu-maxq.c	8 Nov 2004 13:17:36 -0000	1.1
--- bfd/cpu-maxq.c	6 Jan 2005 09:39:08 -0000
***************
*** 24,29 ****
--- 24,47 ----
  #include "sysdep.h"
  #include "libbfd.h"
  
+ 
+ /* This routine is provided two arch_infos and returns whether
+    they'd be compatible */
+ 
+ static const bfd_arch_info_type *
+ compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b)
+ {
+   if (a->arch != b->arch || a->mach != b->mach)
+     return NULL;
+   return a;
+ }
+ 
+ static const bfd_arch_info_type arch_info_struct[] =
+ {
+   { 16, 16, 8, bfd_arch_maxq, bfd_mach_maxq10, "maxq", "maxq10", 0, TRUE,
+     bfd_default_compatible, bfd_default_scan, NULL }
+ };
+ 
  /* MAXQ Archtecture info.  */
  const bfd_arch_info_type bfd_maxq_arch =
  {
*************** const bfd_arch_info_type bfd_maxq_arch =
*** 31,42 ****
    16,				/* 16 bits in an address */
    8,				/* 16 bits in a byte */
    bfd_arch_maxq,		/* enum bfd_archtecture arch */
!   0,				/* only 1 machine */
    "maxq",			/* arch_name */
!   "maxq",			/* printable name */
    0,				/* section align power */
    TRUE,				/* the_default: if this is the machine */
    bfd_default_compatible,	/* bfd_arch_info */
    bfd_default_scan,
!   NULL
  };
--- 49,60 ----
    16,				/* 16 bits in an address */
    8,				/* 16 bits in a byte */
    bfd_arch_maxq,		/* enum bfd_archtecture arch */
!   bfd_mach_maxq20,	
    "maxq",			/* arch_name */
!   "maxq20",		/* printable name */
    0,				/* section align power */
    TRUE,			/* the_default: if this is the machine */
    bfd_default_compatible,	/* bfd_arch_info */
    bfd_default_scan,
!  &arch_info_struct[0]
  };
Index: gas/config/tc-maxq.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-maxq.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 tc-maxq.c
*** gas/config/tc-maxq.c	8 Nov 2004 13:17:22 -0000	1.1
--- gas/config/tc-maxq.c	6 Jan 2005 09:39:13 -0000
***************
*** 70,76 ****
  #define PFX0 0x0b
  
  /* Set default to MAXQ20.  */
! unsigned int max_version = 20;
  
  const char *default_arch = DEFAULT_ARCH;
  
--- 70,76 ----
  #define PFX0 0x0b
  
  /* Set default to MAXQ20.  */
! unsigned int max_version = bfd_mach_maxq20;
  
  const char *default_arch = DEFAULT_ARCH;
  
*************** md_undefined_symbol (char * name ATTRIBU
*** 186,191 ****
--- 186,199 ----
    return NULL;
  }
  
+ void
+ maxq_target (target)
+    int target;
+ {
+    max_version = target;
+    bfd_set_arch_mach (stdoutput, bfd_arch_maxq, max_version);
+ }
+ 
  int
  md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
  {
*************** md_parse_option (int c, char *arg ATTRIB
*** 193,202 ****
    switch (c)
      {
      case MAXQ_10:
!       max_version = 10;
        break;
      case MAXQ_20:
!       max_version = 20;
        break;
  
      default:
--- 201,210 ----
    switch (c)
      {
      case MAXQ_10:
!       max_version = bfd_mach_maxq10;
        break;
      case MAXQ_20:
!       max_version = bfd_mach_maxq20;
        break;
  
      default:
*************** const pseudo_typeS md_pseudo_table[] =
*** 717,722 ****
--- 725,732 ----
  {
    {"int", cons, 2},		/* size of 'int' has been changed to 1 word
  				   (i.e) 16 bits.  */
+   {"maxq10", maxq_target, bfd_mach_maxq10},
+   {"maxq20", maxq_target, bfd_mach_maxq20},
    {NULL, 0, 0},
  };
  
*************** md_begin (void)
*** 2948,2954 ****
  
  	  core_optab->end = optab;
  #ifdef MAXQ10S
! 	  if (max_version == 10)
  	    {
  	      if (((optab - 1)->arch == MAXQ10) || ((optab - 1)->arch == MAX))
  		{
--- 2958,2964 ----
  
  	  core_optab->end = optab;
  #ifdef MAXQ10S
! 	  if (max_version == bfd_mach_maxq10 )
  	    {
  	      if (((optab - 1)->arch == MAXQ10) || ((optab - 1)->arch == MAX))
  		{
*************** md_begin (void)
*** 2957,2963 ****
  					  (PTR) core_optab);
  		}
  	    }
! 	  else if (max_version == 20)
  	    {
  	      /* MAXQ20 */
  	      if (((optab - 1)->arch == MAXQ20) || ((optab - 1)->arch == MAX))
--- 2967,2973 ----
  					  (PTR) core_optab);
  		}
  	    }
! 	  else if (max_version == bfd_mach_maxq20)
  	    {
  	      /* MAXQ20 */
  	      if (((optab - 1)->arch == MAXQ20) || ((optab - 1)->arch == MAX))
*************** md_begin (void)
*** 2993,3004 ****
  #if MAXQ10S
        switch (max_version)
  	{
! 	case 10:		/* MAXQ10 */
  	  if ((reg_tab->arch == MAXQ10) || (reg_tab->arch == MAX))
  	    hash_err = hash_insert (reg_hash, reg_tab->reg_name, (PTR) reg_tab);
  	  break;
  
! 	case 20:		/* MAXQ20 */
  	  if ((reg_tab->arch == MAXQ20) || (reg_tab->arch == MAX))
  	    {
  #endif
--- 3003,3014 ----
  #if MAXQ10S
        switch (max_version)
  	{
! 	case bfd_mach_maxq10 :		/* MAXQ10 */
  	  if ((reg_tab->arch == MAXQ10) || (reg_tab->arch == MAX))
  	    hash_err = hash_insert (reg_hash, reg_tab->reg_name, (PTR) reg_tab);
  	  break;
  
! 	case bfd_mach_maxq20:		/* MAXQ20 */
  	  if ((reg_tab->arch == MAXQ20) || (reg_tab->arch == MAX))
  	    {
  #endif
*************** md_begin (void)
*** 3116,3121 ****
--- 3126,3134 ----
  
    for (p = operand_special_chars; *p != '\0'; p++)
      operand_chars[(unsigned char) *p] = (unsigned char) *p;
+ 
+   /* Set the maxq arch type.  */
+   maxq_target (max_version);
  }
  
  /* md_assemble - Parse Instr - Seprate menmonics and operands - lookup the
Index: include/coff/maxq.h
===================================================================
RCS file: /cvs/src/src/include/coff/maxq.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 maxq.h
*** include/coff/maxq.h	8 Nov 2004 13:17:39 -0000	1.1
--- include/coff/maxq.h	6 Jan 2005 09:39:18 -0000
***************
*** 25,38 ****
  
  /* Bits for f_flags: F_RELFLG relocation info stripped from file F_EXEC file
     is executable (no unresolved external references) F_LNNO line numbers
!    stripped from file F_LSYMS local symbols stripped from file F_AR32WR file
!    has byte ordering of an AR32WR machine (e.g. vax).  */
  
  #define F_RELFLG        (0x0001)
  #define F_EXEC          (0x0002)
  #define F_LNNO          (0x0004)
  #define F_LSYMS         (0x0008)
  
  /* Magic numbers for maxq.  */
  #define MAXQ20MAGIC      0xa0
  #define MAXQ20BADMAG(x) (((x).f_magic != MAXQ20MAGIC))
--- 25,43 ----
  
  /* Bits for f_flags: F_RELFLG relocation info stripped from file F_EXEC file
     is executable (no unresolved external references) F_LNNO line numbers
!    stripped from file F_LSYMS local symbols stripped from file.  */
  
  #define F_RELFLG        (0x0001)
  #define F_EXEC          (0x0002)
  #define F_LNNO          (0x0004)
  #define F_LSYMS         (0x0008)
  
+ /* Variant Specific Flags for MAXQ10 and MAXQ20.  */
+ #define F_MAXQ10	(0x0030)
+ #define F_MAXQ20	(0x0040)
+ 
+ #define F_MACHMASK	(0x00F0)
+ 
  /* Magic numbers for maxq.  */
  #define MAXQ20MAGIC      0xa0
  #define MAXQ20BADMAG(x) (((x).f_magic != MAXQ20MAGIC))

             reply	other threads:[~2005-01-06  9:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06  9:58 Inderpreet Singh Baweja [this message]
2005-01-10 16:36 ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2004-12-28 14:09 Inderpreet Singh Baweja
2005-01-05  9:48 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33BC33A9E76474479B76AD0DE8A16972015C97@exch-ntd.nec.noida.hcltech.com \
    --to=inderpreet.baweja@noida.hcltech.com \
    --cc=binutils@sources.redhat.com \
    --cc=naveen.sharma@noida.hcltech.com \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).