[GSOC] Unified APIs

Joel Sherrill joel.sherrill at OARcorp.com
Tue May 7 17:06:43 UTC 2013


On 5/5/2013 6:07 AM, Vipul Nayyar wrote:
>
>  Hello
>
> As instructed, I've made a custom scriptto identify BSPs which use the 
> PIC API but do not appear to include the complete set of files.
> So taking the example of the tru way of pc386 , it contained 4 
> relevant headers : irq.h ,  irq_asm.h , irq-generic.h , irq-info.h .
Looks pretty good.

I think libbsp/i386/shared/irq.h is BSP specific and equivalent
to include/irq.h in other BSPs (looking at mips/malta).

I am attaching my attempt at the same thing. See what it
reports. I found some items you didn't. And it looks I
missed checking irq.h. I thought it was BSP specific and
it is but I wonder where this information is on other BSPs.
Looks like an inconsistency. Do you see what's inconsistent?

Note: That's a real question. And the point of this project.
To identify rules, check for compliance, find inconsistencies
and kill them. :)
> But in irq_asm.h it's stated that  " This include file has definitions 
> to represent some constants used  to program and manage the  Intel 
> 8259 interrupt controller ". That means this particular header should 
> be irrelevant for other BSPs. So my script checks the Makefile.am for 
> all the BSPs present in lib/libbsp and states whether the relevant irq 
> files are included or not. The bash script and it's output is attached 
> with the email.
>
i386/shared/irq_asm.h is definitely i386 (really i8259 as on PC/AT) specific
and could? possibly be eliminated by being merged into either the .S file
(if only one) that uses it. Or merged into i386/shared/irq.h and wrapped
in "ifndef ASM" conditionals.

This is a case where something could be done.
> I know I must've made  some mistakes. But I'll improve it and send 
> another version of it after doing more research on the BSPs.
>
I think we both likely made mistakes. Not really as wrong as just
part of the discovery process.

Hmm.. the gdbarmsim does not have interrupts in the simulator
so I left out all irq code. Hmm... my script didn't flag this. I
wonder what should be the rule?

Looks good.  Do you feel like you have a good enough handle on this
project or do you want to delve further?
> Regards
> Vipul Nayyar
>
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130507/288cb4fa/attachment-0001.html>
-------------- next part --------------
#! /bin/bash
#

cd $b
if [ ! -d arm ] ; then
  echo Does not look like a BSP directory
  exit 1
fi 

test_its_there()
{
  if [ $# -ne 2 ] ; then
    echo Usage: $0 FILE pattern
  fi
  grep ${2} ${1} >/dev/null
  if [ $? -ne 0 ] ; then
    echo "${2} is NOT in ${basedir}/${1}"
  fi
}

for m in */*/Makefile.am
do
  case ${m} in
    */arm/Makefile.am|*/i386/Makefile.am|*/lm32/Makefile.am|\
    */mips/Makefile.am|*/powerpc/Makefile.am|*/sparc/Makefile.am)
      test_its_there $m shared/include/irq-generic.h
      ;;
    *)
      ;;
  esac

  # If using the irq-generic framework, then check for all
  grep shared/include/irq-generic.h ${m} >/dev/null 2>&1
  if [ $? -eq 0 ] ; then
    test_its_there $m shared/include/irq-info.h
    test_its_there $m shared/src/irq-default-handler.c
    test_its_there $m shared/src/irq-generic.c
    test_its_there $m shared/src/irq-legacy.c
    test_its_there $m shared/src/irq-info.c
    test_its_there $m shared/src/irq-shell.c
    test_its_there $m shared/src/irq-server.c
  fi
done


More information about the devel mailing list