Changeset 758418e in multiio


Ignore:
Timestamp:
Jun 10, 2009, 9:04:23 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
1cbabbe
Parents:
9fb97d3
Message:

2009-06-10 Joel Sherrill <joel.sherrill@…>

  • mio_io.h, mio_io_rtems.c: Add timestamps to buffered interrupts.
  • rtems_config.c: Switch to POSIX Initialization thread and up configured pthreads so application can create one.
Location:
pcmmio/original
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/original/ChangeLog

    r9fb97d3 r758418e  
     12009-06-10      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * mio_io.h, mio_io_rtems.c: Add timestamps to buffered interrupts.
     4        * rtems_config.c: Switch to POSIX Initialization thread and up
     5        configured pthreads so application can create one.
     6
    172009-06-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • pcmmio/original/mio_io.h

    r9fb97d3 r758418e  
    189189int dio_clr_int(int bit_number);
    190190int dio_get_int(void);
     191int dio_get_int_with_timestamp(
     192  unsigned long long *timestamp
     193);
    191194int wait_adc_int(int adc_num);
    192195int wait_dac_int(int dac_num);
  • pcmmio/original/mio_io_rtems.c

    r9fb97d3 r758418e  
    3030
    3131/* Function prototypes for local functions */
    32 int get_buffered_int(void);
     32int get_buffered_int(
     33  unsigned long long *timestamp
     34);
    3335void init_io(unsigned short io_address);
    3436void clr_int(int bit_number);
     
    6264    return -1;
    6365
    64 
    6566  /* All of our programming of the hardware is handled at this level so that
    6667     all of the routines that need to shove and IRQ value into hardware will
     
    323324
    324325
     326int dio_get_int_with_timestamp(
     327  unsigned long long *timestamp
     328)
     329{
     330  if (check_handle())   /* Check for chip available */
     331    return -1;
     332
     333  return get_buffered_int(timestamp) & 0xff;
     334}
     335
    325336int dio_get_int(void)
    326337{
    327   if (check_handle())   /* Check for chip available */
    328     return -1;
    329 
    330   return get_buffered_int() & 0xff;
    331 
     338  return dio_get_int_with_timestamp(NULL);
    332339}
    333340
     
    369376    return -1;
    370377
    371   if((i = get_buffered_int()))
     378  if((i = get_buffered_int(NULL)))
    372379    return i;
    373380
    374381  interruptible_sleep_on(&wq_dio);
    375382
    376   i = get_buffered_int();
     383  i = get_buffered_int(NULL);
    377384
    378385  return i;
     
    498505}
    499506
     507#include <libcpu/cpuModel.h> /* for rdtsc */
    500508
    501509/*
     
    511519#define MAX_INTS 1024
    512520
    513 static unsigned char int_buffer[MAX_INTS];
     521typedef struct {
     522  unsigned char      line;
     523  unsigned long long timestamp;
     524} DIO_Int_t;
     525
     526static DIO_Int_t int_buffer[MAX_INTS];
    514527static int inptr = 0;
    515528static int outptr = 0;
     
    568581      /* Buffer the interrupt */
    569582
    570       int_buffer[inptr++] = int_num;
     583      int_buffer[inptr].timestamp = rdtsc();
     584      int_buffer[inptr].line = int_num;
     585      inptr++;
    571586      if (inptr == MAX_INTS)
    572587        inptr = 0;
     
    700715}
    701716
    702 
    703 int get_buffered_int(void)
    704 {
    705   int temp;
     717int get_buffered_int(
     718  unsigned long long *timestamp
     719)
     720{
     721  int                line;
    706722
    707723  if (irq == 0) {
    708     temp = get_int();
    709     if (temp)
    710       clr_int(temp);
    711     return temp;
     724    line = get_int();
     725    if (line)
     726      clr_int(line);
     727    return line;
    712728  }
    713729
    714730  if (outptr != inptr) {
    715     temp = int_buffer[outptr++];
     731    if ( timestamp )
     732      *timestamp = int_buffer[outptr].timestamp;
     733    line = int_buffer[outptr].line;
     734    outptr++;
    716735    if (outptr == MAX_INTS)
    717736      outptr = 0;
    718     return temp;
    719   }
    720 
    721   return 0;
    722 }
     737    return line;
     738  }
     739
     740  return 0;
     741}
  • pcmmio/original/rtems_config.c

    r9fb97d3 r758418e  
    1010extern int main(int, char **);
    1111
    12 rtems_task Init(
    13   rtems_task_argument ignored
     12void *POSIX_Init(
     13  void *ignored
    1414)
    1515{
     
    1818  main(0,NULL);
    1919  exit(0);
     20  return NULL;
    2021}
    2122
     
    2425#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    2526
    26 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    27 #define CONFIGURE_MAXIMUM_TASKS       1
    28 #define CONFIGURE_MAXIMUM_BARRIERS    4
     27#define CONFIGURE_POSIX_INIT_THREAD_TABLE
     28#define CONFIGURE_MAXIMUM_POSIX_THREADS      2
     29#define CONFIGURE_MAXIMUM_BARRIERS           4
    2930
    3031#define CONFIGURE_INIT
Note: See TracChangeset for help on using the changeset viewer.