Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4191 → Rev 4192

/branches/network/uspace/srv/net/netif/dp8390/dp8390_port.h
34,6 → 34,7
#define __NET_NETIF_DP8390_PORT_H__
 
#include <errno.h>
#include <mem.h>
#include <stdio.h>
#include <libarch/ddi.h>
#include <sys/types.h>
45,31 → 46,21
typedef uint8_t u8_t;
typedef uint16_t u16_t;
 
static inline int memcmp( const void * first, const void * second, size_t length ){
uint8_t * f;
uint8_t * s;
#define memcmp( first, second, size ) bcmp(( char * ) ( first ), ( char * ) ( second ), ( size ))
 
if( ! first ){
return second ? 1 : 0;
}
if( ! second ) return -1;
f = ( uint8_t * ) first;
s = ( uint8_t * ) second;
while(( length > 0 ) && (( * f ) == ( * s ))){
-- length;
++ f;
++ s;
}
return length ? ((( * f ) < ( * s )) ? 1 : -1 ): 0;
}
 
#define inb( port ) pio_read_8(( ioport8_t * ) ( port ))
#define inw( port ) pio_read_16(( ioport16_t * ) ( port ))
#define outb( port, value ) pio_write_8(( ioport8_t * ) ( port ), ( value ))
#define outw( port, value ) pio_write_16(( ioport16_t * ) ( port ), ( value ))
 
#define panic( ... ) { printf( __VA_ARGS__ ); return; }
#define panic( ... ) printf( "%s%s%d", __VA_ARGS__ )
 
#define sys_vircopy( proc, src_s, src, me, dst_s, dst, bytes ) ({ memcpy(( void * )( dst ), ( void * )( src ), ( bytes )); EOK; })
#define do_vir_insb( port, proc, src, bytes ) insb(( port ), ( void * )( src ), ( bytes ))
#define do_vir_insw( port, proc, src, bytes ) insw(( port ), ( void * )( src ), ( bytes ))
#define do_vir_outsb( port, proc, src, bytes ) outsb(( port ), ( void * )( src ), ( bytes ))
#define do_vir_outsw( port, proc, src, bytes ) outsw(( port ), ( void * )( src ), ( bytes ))
 
/* com.h */
/* Bits in 'DL_MODE' field of DL requests. */
# define DL_NOMODE 0x0
83,7 → 74,8
#define NO_NUM 0x8000 /* used as numerical argument to panic() */
 
/* devio.h */
typedef u16_t port_t;
//typedef u16_t port_t;
typedef int port_t;
 
/* dl_eth.h */
typedef struct eth_stat