u-boot_compat.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * (C) Copyright 2003
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _UBOOT_COMPAT_H__
  24. #define _UBOOT_COMPAT_H__
  25. #include <pci.h>
  26. #include <pci_ids.h>
  27. #include <common.h>
  28. #include <malloc.h>
  29. #include <net.h>
  30. #define __initdata
  31. #define __init
  32. #define __exit
  33. #define netif_stop_queue(x)
  34. #define netif_wake_queue(x)
  35. #define netif_running(x) 0
  36. #define unregister_netdev(x)
  37. #define remove_proc_entry(x,y)
  38. #define dev_addr enetaddr
  39. #define spin_lock_irqsave(x,y) y = 0;
  40. #define spin_lock_init(x)
  41. #define spin_lock(x)
  42. #define spin_unlock_irqrestore(x,y)
  43. #define spin_unlock(x)
  44. #define ENODEV 1
  45. #define EAGAIN 2
  46. #define EBUSY 3
  47. #define HZ CONFIG_SYS_HZ
  48. #define printk printf
  49. #define KERN_ERR
  50. #define KERN_WARNING
  51. #define KERN_INFO
  52. #define MOD_INC_USE_COUNT
  53. #define MOD_DEC_USE_COUNT
  54. #define kmalloc(x,y) malloc(x)
  55. #define kfree(x) free(x)
  56. #define GFP_ATOMIC 0
  57. #define pci_alloc_consistent(x,y,z) (void *)(*(dma_addr_t *)(z) = (dma_addr_t)malloc(y))
  58. #define pci_free_consistent(x,y,z,d) free(z)
  59. #define pci_dma_sync_single(x,y,z,d)
  60. #define pci_unmap_page(x,y,z,d)
  61. #define pci_unmap_single(x,y,z,d)
  62. #define pci_present() 1
  63. struct sk_buff
  64. {
  65. u8 * data;
  66. u32 len;
  67. u8 * data_unaligned;
  68. };
  69. struct sk_buff * alloc_skb(u32 size, int dummy);
  70. void dev_kfree_skb_any(struct sk_buff *skb);
  71. void skb_reserve(struct sk_buff *skb, unsigned int len);
  72. void skb_put(struct sk_buff *skb, unsigned int len);
  73. #define dev_kfree_skb dev_kfree_skb_any
  74. #define dev_kfree_skb_irq dev_kfree_skb_any
  75. #define eth_copy_and_sum(dest,src,len,base) memcpy(dest->data,src,len);
  76. #endif /* _UBOOT_COMPAT_H__ */