2003-04-02 Marcel Telka <marcel@telka.sk>

* include/signal.h: Changed signal typedef to signal_t (thanks to Jachym Holecek).
		All `signal' instances renamed to `signal_t'.
	* src/tap/parport.c: Ported to NetBSD/i386 (Jachym Holecek).
	* src/tap/parport/direct.c (parport_drivers): Conditionally removed direct_parport_driver.
	* configure.ac: Added test for i386_set_ioperm() function. Defined HAVE_IOPERM
		and HAVE_I386_SET_IOPERM.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@412 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent bffcf9e111
commit 882094c9a3

@ -1,3 +1,12 @@
2003-04-02 Marcel Telka <marcel@telka.sk>
* include/signal.h: Changed signal typedef to signal_t (thanks to Jachym Holecek).
All `signal' instances renamed to `signal_t'.
* src/tap/parport.c: Ported to NetBSD/i386 (Jachym Holecek).
* src/tap/parport/direct.c (parport_drivers): Conditionally removed direct_parport_driver.
* configure.ac: Added test for i386_set_ioperm() function. Defined HAVE_IOPERM
and HAVE_I386_SET_IOPERM.
2003-04-01 Marcel Telka <marcel@telka.sk>
* src/tap/cable/keithkoep.c: New file.

@ -1,6 +1,7 @@
$Id$
* Added driver for Keith & Koep JTAG Cable.
* Ported to NetBSD/i386 (Jachym Holecek).
jtag-0.3.1 (2003-03-19):

@ -23,12 +23,13 @@ Feedback and contributions are welcome.
Supported operating systems
---------------------------
JTAG Tools should run on all x86 Unix like operating systems including
JTAG Tools should run on all Unix like operating systems including
MS Windows 95/98/Me/NT/2000/XP with Cygwin installed.
Tested operating systems:
- RedHat Linux 8.0
- MS Windows 2000/XP + Cygwin
- NetBSD/i386
Supported hardware

@ -3,6 +3,7 @@ $Id$
Ian Campbell
Alex (d18c7db)
Chris Ellec
Jachym Holecek
August Hörandl
Stas Khirman
Christian Pellegrin

@ -75,6 +75,16 @@ fi
CPPFLAGS="$CPPFLAGS -I$openwince_includes_path -I$openwince_includes_path/device"
AC_SEARCH_LIBS([ioperm], [ioperm])
if test "$ac_cv_search_ioperm" != "no"; then
AC_DEFINE(HAVE_IOPERM, 1, [Define to 1 if you have the ioperm() function])
else
AC_SEARCH_LIBS([i386_set_ioperm], [i386])
if test "$ac_cv_search_i386_set_ioperm" != "no"; then
AC_DEFINE(HAVE_I386_SET_IOPERM, 1,
[Define to 1 if you have the i386_set_ioperm() function])
fi
fi
AC_CHECK_FUNCS(getline getdelim)
AC_CHECK_HEADERS(linux/ppdev.h)

@ -41,14 +41,14 @@ struct bsbit {
int bit;
char *name;
int type;
signal *signal;
signal_t *signal;
int safe; /* safe value */
int control; /* -1 for none */
int control_value;
int control_state;
};
bsbit *bsbit_alloc( int bit, const char *name, int type, signal* signals, int safe );
bsbit *bsbit_alloc( int bit, const char *name, int type, signal_t* signals, int safe );
void bsbit_free( bsbit *b );
#endif /* BSBIT_H */

@ -43,7 +43,7 @@ struct part {
char manufacturer[MAXLEN_MANUFACTURER + 1];
char part[MAXLEN_PART + 1];
char stepping[MAXLEN_STEPPING + 1];
signal *signals;
signal_t *signals;
int instruction_length;
instruction *instructions;
instruction *active_instruction;

@ -25,18 +25,18 @@
#ifndef SIGNAL_H
#define SIGNAL_H
typedef struct signal signal;
typedef struct signal signal_t;
#include <bsbit.h>
struct signal {
char *name;
signal *next;
signal_t *next;
bsbit *input;
bsbit *output;
};
signal *signal_alloc( const char *name );
void signal_free( signal *s );
signal_t *signal_alloc( const char *name );
void signal_free( signal_t *s );
#endif /* SIGNAL_H */

@ -28,9 +28,9 @@
#include "bsbit.h"
bsbit *
bsbit_alloc( int bit, const char *name, int type, signal* signals, int safe )
bsbit_alloc( int bit, const char *name, int type, signal_t* signals, int safe )
{
signal *s = signals;
signal_t *s = signals;
bsbit *b = malloc( sizeof *b );
if (!b)

@ -68,7 +68,7 @@ read_part( FILE *f, tap_register *idr )
/* pin */
if (strcmp( t, "pin" ) == 0) {
signal *s;
signal_t *s;
t = get_token( NULL );
if (!t) {

@ -60,7 +60,7 @@ part_free( part *p )
/* sirnals */
while (p->signals) {
signal *s = p->signals;
signal_t *s = p->signals;
p->signals = s->next;
signal_free( s );
}
@ -132,7 +132,7 @@ void part_set_instruction( part *p, const char *iname )
void
part_set_signal( part *p, const char *pname, int out, int val )
{
signal *s;
signal_t *s;
/* search for Boundary Scan Register */
data_register *bsr = part_find_data_register( p, "BSR" );
@ -179,7 +179,7 @@ part_set_signal( part *p, const char *pname, int out, int val )
int
part_get_signal( part *p, const char *pname )
{
signal *s;
signal_t *s;
/* search for Boundary Scan Register */
data_register *bsr = part_find_data_register( p, "BSR" );

@ -27,10 +27,10 @@
#include "signal.h"
signal *
signal_t *
signal_alloc( const char *name )
{
signal *s = malloc( sizeof *s );
signal_t *s = malloc( sizeof *s );
if (!s)
return NULL;
@ -47,7 +47,7 @@ signal_alloc( const char *name )
}
void
signal_free( signal *s )
signal_free( signal_t *s )
{
if (!s)
return;

@ -28,13 +28,17 @@
#include "parport.h"
#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM)
extern parport_driver_t direct_parport_driver;
#endif /* defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) */
#ifdef HAVE_LINUX_PPDEV_H
extern parport_driver_t ppdev_parport_driver;
#endif /* HAVE_LINUX_PPDEV_H */
parport_driver_t *parport_drivers[] = {
#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM)
&direct_parport_driver,
#endif /* defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) */
#ifdef HAVE_LINUX_PPDEV_H
&ppdev_parport_driver,
#endif /* HAVE_LINUX_PPDEV_H */

@ -20,6 +20,7 @@
* 02111-1307, USA.
*
* Written by Marcel Telka <marcel@telka.sk>, 2003.
* Ported to NetBSD/i386 by Jachym Holecek <freza@psi.cz>, 2003.
*
*/
@ -33,12 +34,65 @@
#define P_(s,p,n) ngettext(s,p,n)
#include <stdlib.h>
#include <sys/io.h>
#include <string.h>
#include "parport.h"
#include "cable.h"
#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM)
#if defined(HAVE_IOPERM)
#include <sys/io.h>
#elif defined(HAVE_I386_SET_IOPERM)
#include <sys/types.h>
#include <machine/sysarch.h>
#include <err.h>
#endif
#ifdef HAVE_I386_SET_IOPERM
static __inline int
ioperm( unsigned long from, unsigned long num, int permit )
{
u_long ports[32];
u_long i;
if (i386_get_ioperm( ports ) == -1)
return -1;
for (i = from; i < (from + num); i++)
if (permit)
ports[i / 32] &= ~(1 << (i % 32));
else
ports[i / 32] |= (1 << (i % 32));
if (i386_set_ioperm( ports ) == -1)
return -1;
return 0;
}
static __inline int
iopl( int level )
{
return i386_iopl( level );
}
static __inline unsigned char
inb( unsigned short int port )
{
unsigned char _v;
__asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
return _v;
}
static __inline void
outb( unsigned char value, unsigned short int port )
{
__asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
}
#endif /* HAVE_I386_SET_IOPERM */
parport_driver_t direct_parport_driver;
typedef struct port_node_t port_node_t;
@ -216,3 +270,5 @@ parport_driver_t direct_parport_driver = {
direct_get_status,
direct_set_control
};
#endif /* defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) */

Loading…
Cancel
Save