fix build for echo drivers, added cs_timer.h from pcmcia-cs

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15591 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2005-12-19 18:57:29 +00:00
parent 8c85eedc66
commit 37a84232bb
5 changed files with 110 additions and 19 deletions

View File

@ -1,3 +1,32 @@
/*
* cb_enabler.h
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License
* at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
* <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License version 2 (the "GPL"), in
* which case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file
* under either the MPL or the GPL.
*/
#ifndef _CB_ENABLER_H #ifndef _CB_ENABLER_H
#define _CB_ENABLER_H #define _CB_ENABLER_H

View File

@ -0,0 +1,42 @@
/*
* cs_timer.h
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License
* at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
* <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License version 2 (the "GPL"), in
* which case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file
* under either the MPL or the GPL.
*/
#define HZ 1000000
#define jiffies (system_time())
#define RUN_AT(t) (system_time()+(t))
typedef struct timer_list {
struct timer_list *next, *prev;
bigtime_t expires;
u_long data;
void (*function)(u_long data);
} timer_list;
void my_add_timer(struct timer_list *t);
void my_del_timer(struct timer_list *t);

View File

@ -68,15 +68,6 @@ typedef struct driver_operations {
int register_driver(struct driver_operations *ops); int register_driver(struct driver_operations *ops);
void unregister_driver(struct driver_operations *ops); void unregister_driver(struct driver_operations *ops);
#ifdef __BEOS__
#define CB_ENABLER_MODULE_NAME "bus_managers/cb_enabler/v1"
typedef struct cb_enabler_module_info {
bus_manager_info binfo;
int (*register_driver)(struct driver_operations *ops);
void (*unregister_driver)(struct driver_operations *ops);
} cb_enabler_module_info;
#endif /* __BEOS__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _LINUX_DRIVER_OPS_H */ #endif /* _LINUX_DRIVER_OPS_H */

View File

@ -26,8 +26,16 @@
#include <ByteOrder.h> #include <ByteOrder.h>
#include <SupportDefs.h> #include <SupportDefs.h>
#include <config_manager.h> #include <config_manager.h>
#include <stdio.h>
#include <string.h>
#define u32 uint32
#define u16 uint16
#define u8 uint8
#define __KERNEL__ #define __KERNEL__
#define __init
#define __exit
/* IO port access */ /* IO port access */
#define inb(p) (isa->read_io_8)(p) #define inb(p) (isa->read_io_8)(p)
@ -65,7 +73,7 @@
/* Virtual memory mapping: this is somewhat inelegant, but lets us /* Virtual memory mapping: this is somewhat inelegant, but lets us
use drop-in replacements for the Linux equivalents */ use drop-in replacements for the Linux equivalents */
#define PAGE_SIZE (0x1000) // #define PAGE_SIZE (0x1000)
static inline void *ioremap(u_long base, u_long size) static inline void *ioremap(u_long base, u_long size)
{ {
char tag[B_OS_NAME_LENGTH]; char tag[B_OS_NAME_LENGTH];
@ -128,11 +136,11 @@ void free(void *);
#define pcibios_read_config_dword(b,df,o,v) \ #define pcibios_read_config_dword(b,df,o,v) \
((*(v) = pci->read_pci_config(b,(df)>>3,((df)&7),o,4)),0) ((*(v) = pci->read_pci_config(b,(df)>>3,((df)&7),o,4)),0)
#define pcibios_write_config_byte(b,df,o,v) \ #define pcibios_write_config_byte(b,df,o,v) \
pci->write_pci_config(b,(df)>>3,((df)&7),o,1,v) (pci->write_pci_config(b,(df)>>3,((df)&7),o,1,v),0)
#define pcibios_write_config_word(b,df,o,v) \ #define pcibios_write_config_word(b,df,o,v) \
pci->write_pci_config(b,(df)>>3,((df)&7),o,2,v) (pci->write_pci_config(b,(df)>>3,((df)&7),o,2,v),0)
#define pcibios_write_config_dword(b,df,o,v) \ #define pcibios_write_config_dword(b,df,o,v) \
pci->write_pci_config(b,(df)>>3,((df)&7),o,4,v) (pci->write_pci_config(b,(df)>>3,((df)&7),o,4,v),0)
#define PCI_VENDOR_ID PCI_vendor_id #define PCI_VENDOR_ID PCI_vendor_id
#define PCI_DEVICE_ID PCI_device_id #define PCI_DEVICE_ID PCI_device_id
#define PCI_COMMAND PCI_command #define PCI_COMMAND PCI_command
@ -172,11 +180,15 @@ void free(void *);
do { release_spinlock(l); restore_interrupts(f); } while (0) do { release_spinlock(l); restore_interrupts(f); } while (0)
/* Interrupt handling */ /* Interrupt handling */
#define REQUEST_IRQ(i,h,f,n,d) install_io_interrupt_handler(i,h,d,0) #define request_irq(i,h,f,n,d) install_io_interrupt_handler(i,h,d,0)
#define FREE_IRQ(i,h,d) remove_io_interrupt(i,h) #define free_irq(i,h) remove_io_interrupt(i,h)
#define IRQ(i,d,r) (d) //#define REQUEST_IRQ(i,h,f,n,d) install_io_interrupt_handler(i,h,d,0)
//#define FREE_IRQ(i,h,d) remove_io_interrupt(i,h)
//#define IRQ(i,d,r) (d)
#define IRQ
#define DEV_ID dev_id #define DEV_ID dev_id
#define NR_IRQS 16 #define NR_IRQS 16
#define SA_SHIRQ 1
#define init_waitqueue(w) memset((w), 0, sizeof(*w)) #define init_waitqueue(w) memset((w), 0, sizeof(*w))
#define init_waitqueue_head(w) memset((w), 0, sizeof(*w)) #define init_waitqueue_head(w) memset((w), 0, sizeof(*w))
@ -204,6 +216,9 @@ typedef long long k_time_t;
#define del_timer my_del_timer #define del_timer my_del_timer
/* Module handling stuff */ /* Module handling stuff */
#define MODULE_AUTHOR(x)
#define MODULE_DESCRIPTION(x)
#define MODULE_LICENSE(x)
#define MODULE_PARM(a,b) extern int __dummy_decl #define MODULE_PARM(a,b) extern int __dummy_decl
#define MOD_INC_USE_COUNT #define MOD_INC_USE_COUNT
#define MOD_DEC_USE_COUNT #define MOD_DEC_USE_COUNT

View File

@ -1,5 +1,5 @@
/* /*
* ss.h 1.23 1999/07/20 16:08:01 * ss.h 1.31 2001/08/24 12:16:13
* *
* The contents of this file are subject to the Mozilla Public License * The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in * Version 1.1 (the "License"); you may not use this file except in
@ -12,8 +12,19 @@
* limitations under the License. * limitations under the License.
* *
* The initial developer of the original code is David A. Hinds * The initial developer of the original code is David A. Hinds
* <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
* are Copyright (C) 1998 David A. Hinds. All Rights Reserved. * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License version 2 (the "GPL"), in
* which case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision by
* deleting the provisions above and replace them with the notice and
* other provisions required by the GPL. If you do not delete the
* provisions above, a recipient may use your version of this file
* under either the MPL or the GPL.
*/ */
#ifndef _LINUX_SS_H #ifndef _LINUX_SS_H
@ -40,6 +51,7 @@ typedef struct ss_callback_t {
#define SS_CARDBUS 0x0800 #define SS_CARDBUS 0x0800
#define SS_3VCARD 0x1000 #define SS_3VCARD 0x1000
#define SS_XVCARD 0x2000 #define SS_XVCARD 0x2000
#define SS_PENDING 0x4000
/* for InquireSocket */ /* for InquireSocket */
typedef struct socket_cap_t { typedef struct socket_cap_t {
@ -56,6 +68,7 @@ typedef struct socket_cap_t {
#define SS_CAP_PAGE_REGS 0x0001 #define SS_CAP_PAGE_REGS 0x0001
#define SS_CAP_VIRTUAL_BUS 0x0002 #define SS_CAP_VIRTUAL_BUS 0x0002
#define SS_CAP_MEM_ALIGN 0x0004 #define SS_CAP_MEM_ALIGN 0x0004
#define SS_CAP_STATIC_MAP 0x0008
#define SS_CAP_PCCARD 0x4000 #define SS_CAP_PCCARD 0x4000
#define SS_CAP_CARDBUS 0x8000 #define SS_CAP_CARDBUS 0x8000
@ -74,6 +87,7 @@ typedef struct socket_state_t {
#define SS_DMA_MODE 0x0080 #define SS_DMA_MODE 0x0080
#define SS_SPKR_ENA 0x0100 #define SS_SPKR_ENA 0x0100
#define SS_OUTPUT_ENA 0x0200 #define SS_OUTPUT_ENA 0x0200
#define SS_ZVCARD 0x0400
/* Flags for I/O port and memory windows */ /* Flags for I/O port and memory windows */
#define MAP_ACTIVE 0x01 #define MAP_ACTIVE 0x01