2
2
* Linux OS Independent Layer
4
* Copyright (C) 2010, Broadcom Corporation
7
* THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8
* KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9
* SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10
* FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
4
* Copyright (C) 2011, Broadcom Corporation. All Rights Reserved.
6
* Permission to use, copy, modify, and/or distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
* $Id: linux_osl.h,v 13.160.2.6 2010-08-31 00:30:03 Exp $
18
* $Id: linux_osl.h 241182 2011-02-17 21:50:03Z $
15
21
#ifndef _linux_osl_h_
20
26
extern void * osl_os_open_image(char * filename);
21
27
extern int osl_os_get_image_block(char * buf, int len, void * image);
22
28
extern void osl_os_close_image(void * image);
29
extern int osl_os_image_size(void *image);
24
31
extern osl_t *osl_attach(void *pdev, uint bustype, bool pkttag);
25
32
extern void osl_detach(osl_t *osh);
29
36
#if defined(BCMDBG_ASSERT)
30
37
#define ASSERT(exp) \
31
38
do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
32
extern void osl_assert(char *exp, char *file, int line);
39
extern void osl_assert(const char *exp, const char *file, int line);
35
42
#define GCC_VERSION \
92
99
#define NATIVE_MALLOC(osh, size) kmalloc(size, GFP_ATOMIC)
93
100
#define NATIVE_MFREE(osh, addr, size) kfree(addr)
95
#include <linux/vmalloc.h>
96
#define VMALLOC(osh, size) vmalloc(size)
97
#define VFREE(osh, addr, size) vfree(addr)
100
102
#define MALLOC_FAILED(osh) osl_malloc_failed((osh))
101
103
extern uint osl_malloc_failed(osl_t *osh);