1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * OS Abstraction Layer 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Portions of this code are copyright (c) 2021 Cypress Semiconductor Corporation 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * Copyright (C) 1999-2017, Broadcom Corporation 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * Unless you and Broadcom execute a separate written software license 9*4882a593Smuzhiyun * agreement governing use of this software, this software is licensed to you 10*4882a593Smuzhiyun * under the terms of the GNU General Public License version 2 (the "GPL"), 11*4882a593Smuzhiyun * available at http://www.broadcom.com/licenses/GPLv2.php, with the 12*4882a593Smuzhiyun * following added to such license: 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun * As a special exception, the copyright holders of this software give you 15*4882a593Smuzhiyun * permission to link this software with independent modules, and to copy and 16*4882a593Smuzhiyun * distribute the resulting executable under terms of your choice, provided that 17*4882a593Smuzhiyun * you also meet, for each linked independent module, the terms and conditions of 18*4882a593Smuzhiyun * the license of that module. An independent module is a module which is not 19*4882a593Smuzhiyun * derived from this software. The special exception does not apply to any 20*4882a593Smuzhiyun * modifications of the software. 21*4882a593Smuzhiyun * 22*4882a593Smuzhiyun * Notwithstanding the above, under no circumstances may you combine this 23*4882a593Smuzhiyun * software in any way with any other Broadcom software provided under a license 24*4882a593Smuzhiyun * other than the GPL, without Broadcom's express prior written consent. 25*4882a593Smuzhiyun * 26*4882a593Smuzhiyun * 27*4882a593Smuzhiyun * <<Broadcom-WL-IPTag/Open:>> 28*4882a593Smuzhiyun * 29*4882a593Smuzhiyun * $Id: osl.h 673906 2016-12-05 19:59:39Z $ 30*4882a593Smuzhiyun */ 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun #ifndef _osl_h_ 33*4882a593Smuzhiyun #define _osl_h_ 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun #include <osl_decl.h> 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun enum { 38*4882a593Smuzhiyun TAIL_BYTES_TYPE_FCS = 1, 39*4882a593Smuzhiyun TAIL_BYTES_TYPE_ICV = 2, 40*4882a593Smuzhiyun TAIL_BYTES_TYPE_MIC = 3 41*4882a593Smuzhiyun }; 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun #define OSL_PKTTAG_SZ 48 /* standard linux pkttag size is 48 bytes */ 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun /* Drivers use PKTFREESETCB to register a callback function when a packet is freed by OSL */ 46*4882a593Smuzhiyun typedef void (*pktfree_cb_fn_t)(void *ctx, void *pkt, unsigned int status); 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun /* Drivers use REGOPSSET() to register register read/write funcitons */ 49*4882a593Smuzhiyun typedef unsigned int (*osl_rreg_fn_t)(void *ctx, volatile void *reg, unsigned int size); 50*4882a593Smuzhiyun typedef void (*osl_wreg_fn_t)(void *ctx, volatile void *reg, unsigned int val, unsigned int size); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun #if defined(WL_UNITTEST) 53*4882a593Smuzhiyun #include <utest_osl.h> 54*4882a593Smuzhiyun #else 55*4882a593Smuzhiyun #include <linux_osl.h> 56*4882a593Smuzhiyun #include <linux_pkt.h> 57*4882a593Smuzhiyun #endif // endif 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun #ifndef PKTDBG_TRACE 60*4882a593Smuzhiyun #define PKTDBG_TRACE(osh, pkt, bit) BCM_REFERENCE(osh) 61*4882a593Smuzhiyun #endif // endif 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun #define PKTCTFMAP(osh, p) BCM_REFERENCE(osh) 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun /* -------------------------------------------------------------------------- 66*4882a593Smuzhiyun ** Register manipulation macros. 67*4882a593Smuzhiyun */ 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun #define SET_REG(osh, r, mask, val) W_REG((osh), (r), ((R_REG((osh), r) & ~(mask)) | (val))) 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun #ifndef AND_REG 72*4882a593Smuzhiyun #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v)) 73*4882a593Smuzhiyun #endif /* !AND_REG */ 74*4882a593Smuzhiyun 75*4882a593Smuzhiyun #ifndef OR_REG 76*4882a593Smuzhiyun #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v)) 77*4882a593Smuzhiyun #endif /* !OR_REG */ 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun #if !defined(OSL_SYSUPTIME) 80*4882a593Smuzhiyun #define OSL_SYSUPTIME() (0) 81*4882a593Smuzhiyun #define OSL_SYSUPTIME_NOT_DEFINED 1 82*4882a593Smuzhiyun #endif /* !defined(OSL_SYSUPTIME) */ 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun #if !defined(OSL_SYSUPTIME_US) 85*4882a593Smuzhiyun #define OSL_SYSUPTIME_US() (0) 86*4882a593Smuzhiyun #define OSL_SYSUPTIME_US_NOT_DEFINED 1 87*4882a593Smuzhiyun #endif /* !defined(OSL_SYSUPTIME) */ 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun #if defined(OSL_SYSUPTIME_NOT_DEFINED) && defined(OSL_SYSUPTIME_US_NOT_DEFINED) 90*4882a593Smuzhiyun #define OSL_SYSUPTIME_SUPPORT FALSE 91*4882a593Smuzhiyun #else 92*4882a593Smuzhiyun #define OSL_SYSUPTIME_SUPPORT TRUE 93*4882a593Smuzhiyun #endif /* OSL_SYSUPTIME */ 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun #ifndef OSL_GET_LOCALTIME 96*4882a593Smuzhiyun #define OSL_GET_LOCALTIME(sec, usec) \ 97*4882a593Smuzhiyun do { \ 98*4882a593Smuzhiyun BCM_REFERENCE(sec); \ 99*4882a593Smuzhiyun BCM_REFERENCE(usec); \ 100*4882a593Smuzhiyun } while (0) 101*4882a593Smuzhiyun #endif /* OSL_GET_LOCALTIME */ 102*4882a593Smuzhiyun 103*4882a593Smuzhiyun #ifndef OSL_LOCALTIME_NS 104*4882a593Smuzhiyun #define OSL_LOCALTIME_NS() (OSL_SYSUPTIME_US() * NSEC_PER_USEC) 105*4882a593Smuzhiyun #endif /* OSL_LOCALTIME_NS */ 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun #ifndef OSL_SYSTZTIME_US 108*4882a593Smuzhiyun #define OSL_SYSTZTIME_US() OSL_SYSUPTIME_US() 109*4882a593Smuzhiyun #endif /* OSL_GET_SYSTZTIME */ 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun #ifndef OSL_SYS_HALT 112*4882a593Smuzhiyun #define OSL_SYS_HALT() do {} while (0) 113*4882a593Smuzhiyun #endif // endif 114*4882a593Smuzhiyun 115*4882a593Smuzhiyun #ifndef DMB 116*4882a593Smuzhiyun #if defined(STB) 117*4882a593Smuzhiyun #define DMB() mb(); 118*4882a593Smuzhiyun #else /* STB */ 119*4882a593Smuzhiyun #define DMB() do {} while (0) 120*4882a593Smuzhiyun #endif /* STB */ 121*4882a593Smuzhiyun #endif /* DMB */ 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun #ifndef OSL_MEM_AVAIL 124*4882a593Smuzhiyun #define OSL_MEM_AVAIL() (0xffffffff) 125*4882a593Smuzhiyun #endif // endif 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun #ifndef OSL_OBFUSCATE_BUF 128*4882a593Smuzhiyun /* For security reasons printing pointers is not allowed. 129*4882a593Smuzhiyun * Some OSLs implement OSL_OBFUSCATE_BUF to OS specific obfuscate API. 130*4882a593Smuzhiyun * If OSL_OBFUSCATE_BUF() is not implemented in OSL, then default to 131*4882a593Smuzhiyun * printing the input pointer 132*4882a593Smuzhiyun */ 133*4882a593Smuzhiyun #define OSL_OBFUSCATE_BUF(x) (x) 134*4882a593Smuzhiyun #endif /* OSL_OBFUSCATE_BUF */ 135*4882a593Smuzhiyun 136*4882a593Smuzhiyun #if !defined(PKTC_DONGLE) 137*4882a593Smuzhiyun 138*4882a593Smuzhiyun #define PKTCGETATTR(skb) (0) 139*4882a593Smuzhiyun #define PKTCSETATTR(skb, f, p, b) BCM_REFERENCE(skb) 140*4882a593Smuzhiyun #define PKTCCLRATTR(skb) BCM_REFERENCE(skb) 141*4882a593Smuzhiyun #define PKTCCNT(skb) (1) 142*4882a593Smuzhiyun #define PKTCLEN(skb) PKTLEN(NULL, skb) 143*4882a593Smuzhiyun #define PKTCGETFLAGS(skb) (0) 144*4882a593Smuzhiyun #define PKTCSETFLAGS(skb, f) BCM_REFERENCE(skb) 145*4882a593Smuzhiyun #define PKTCCLRFLAGS(skb) BCM_REFERENCE(skb) 146*4882a593Smuzhiyun #define PKTCFLAGS(skb) (0) 147*4882a593Smuzhiyun #define PKTCSETCNT(skb, c) BCM_REFERENCE(skb) 148*4882a593Smuzhiyun #define PKTCINCRCNT(skb) BCM_REFERENCE(skb) 149*4882a593Smuzhiyun #define PKTCADDCNT(skb, c) BCM_REFERENCE(skb) 150*4882a593Smuzhiyun #define PKTCSETLEN(skb, l) BCM_REFERENCE(skb) 151*4882a593Smuzhiyun #define PKTCADDLEN(skb, l) BCM_REFERENCE(skb) 152*4882a593Smuzhiyun #define PKTCSETFLAG(skb, fb) BCM_REFERENCE(skb) 153*4882a593Smuzhiyun #define PKTCCLRFLAG(skb, fb) BCM_REFERENCE(skb) 154*4882a593Smuzhiyun #define PKTCLINK(skb) NULL 155*4882a593Smuzhiyun #define PKTSETCLINK(skb, x) BCM_REFERENCE(skb) 156*4882a593Smuzhiyun #define FOREACH_CHAINED_PKT(skb, nskb) \ 157*4882a593Smuzhiyun for ((nskb) = NULL; (skb) != NULL; (skb) = (nskb)) 158*4882a593Smuzhiyun #define PKTCFREE PKTFREE 159*4882a593Smuzhiyun #define PKTCENQTAIL(h, t, p) \ 160*4882a593Smuzhiyun do { \ 161*4882a593Smuzhiyun if ((t) == NULL) { \ 162*4882a593Smuzhiyun (h) = (t) = (p); \ 163*4882a593Smuzhiyun } \ 164*4882a593Smuzhiyun } while (0) 165*4882a593Smuzhiyun #endif // endif 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun #ifndef PKTSETCHAINED 168*4882a593Smuzhiyun #define PKTSETCHAINED(osh, skb) BCM_REFERENCE(osh) 169*4882a593Smuzhiyun #endif // endif 170*4882a593Smuzhiyun #ifndef PKTCLRCHAINED 171*4882a593Smuzhiyun #define PKTCLRCHAINED(osh, skb) BCM_REFERENCE(osh) 172*4882a593Smuzhiyun #endif // endif 173*4882a593Smuzhiyun #ifndef PKTISCHAINED 174*4882a593Smuzhiyun #define PKTISCHAINED(skb) FALSE 175*4882a593Smuzhiyun #endif // endif 176*4882a593Smuzhiyun 177*4882a593Smuzhiyun /* Lbuf with fraglist */ 178*4882a593Smuzhiyun #ifndef PKTFRAGPKTID 179*4882a593Smuzhiyun #define PKTFRAGPKTID(osh, lb) (0) 180*4882a593Smuzhiyun #endif // endif 181*4882a593Smuzhiyun #ifndef PKTSETFRAGPKTID 182*4882a593Smuzhiyun #define PKTSETFRAGPKTID(osh, lb, id) BCM_REFERENCE(osh) 183*4882a593Smuzhiyun #endif // endif 184*4882a593Smuzhiyun #ifndef PKTFRAGTOTNUM 185*4882a593Smuzhiyun #define PKTFRAGTOTNUM(osh, lb) (0) 186*4882a593Smuzhiyun #endif // endif 187*4882a593Smuzhiyun #ifndef PKTSETFRAGTOTNUM 188*4882a593Smuzhiyun #define PKTSETFRAGTOTNUM(osh, lb, tot) BCM_REFERENCE(osh) 189*4882a593Smuzhiyun #endif // endif 190*4882a593Smuzhiyun #ifndef PKTFRAGTOTLEN 191*4882a593Smuzhiyun #define PKTFRAGTOTLEN(osh, lb) (0) 192*4882a593Smuzhiyun #endif // endif 193*4882a593Smuzhiyun #ifndef PKTSETFRAGTOTLEN 194*4882a593Smuzhiyun #define PKTSETFRAGTOTLEN(osh, lb, len) BCM_REFERENCE(osh) 195*4882a593Smuzhiyun #endif // endif 196*4882a593Smuzhiyun #ifndef PKTIFINDEX 197*4882a593Smuzhiyun #define PKTIFINDEX(osh, lb) (0) 198*4882a593Smuzhiyun #endif // endif 199*4882a593Smuzhiyun #ifndef PKTSETIFINDEX 200*4882a593Smuzhiyun #define PKTSETIFINDEX(osh, lb, idx) BCM_REFERENCE(osh) 201*4882a593Smuzhiyun #endif // endif 202*4882a593Smuzhiyun #ifndef PKTGETLF 203*4882a593Smuzhiyun #define PKTGETLF(osh, len, send, lbuf_type) (0) 204*4882a593Smuzhiyun #endif // endif 205*4882a593Smuzhiyun 206*4882a593Smuzhiyun /* in rx path, reuse totlen as used len */ 207*4882a593Smuzhiyun #ifndef PKTFRAGUSEDLEN 208*4882a593Smuzhiyun #define PKTFRAGUSEDLEN(osh, lb) (0) 209*4882a593Smuzhiyun #endif // endif 210*4882a593Smuzhiyun #ifndef PKTSETFRAGUSEDLEN 211*4882a593Smuzhiyun #define PKTSETFRAGUSEDLEN(osh, lb, len) BCM_REFERENCE(osh) 212*4882a593Smuzhiyun #endif // endif 213*4882a593Smuzhiyun #ifndef PKTFRAGLEN 214*4882a593Smuzhiyun #define PKTFRAGLEN(osh, lb, ix) (0) 215*4882a593Smuzhiyun #endif // endif 216*4882a593Smuzhiyun #ifndef PKTSETFRAGLEN 217*4882a593Smuzhiyun #define PKTSETFRAGLEN(osh, lb, ix, len) BCM_REFERENCE(osh) 218*4882a593Smuzhiyun #endif // endif 219*4882a593Smuzhiyun #ifndef PKTFRAGDATA_LO 220*4882a593Smuzhiyun #define PKTFRAGDATA_LO(osh, lb, ix) (0) 221*4882a593Smuzhiyun #endif // endif 222*4882a593Smuzhiyun #ifndef PKTSETFRAGDATA_LO 223*4882a593Smuzhiyun #define PKTSETFRAGDATA_LO(osh, lb, ix, addr) BCM_REFERENCE(osh) 224*4882a593Smuzhiyun #endif // endif 225*4882a593Smuzhiyun #ifndef PKTFRAGDATA_HI 226*4882a593Smuzhiyun #define PKTFRAGDATA_HI(osh, lb, ix) (0) 227*4882a593Smuzhiyun #endif // endif 228*4882a593Smuzhiyun #ifndef PKTSETFRAGDATA_HI 229*4882a593Smuzhiyun #define PKTSETFRAGDATA_HI(osh, lb, ix, addr) BCM_REFERENCE(osh) 230*4882a593Smuzhiyun #endif // endif 231*4882a593Smuzhiyun 232*4882a593Smuzhiyun /* RX FRAG */ 233*4882a593Smuzhiyun #ifndef PKTISRXFRAG 234*4882a593Smuzhiyun #define PKTISRXFRAG(osh, lb) (0) 235*4882a593Smuzhiyun #endif // endif 236*4882a593Smuzhiyun #ifndef PKTSETRXFRAG 237*4882a593Smuzhiyun #define PKTSETRXFRAG(osh, lb) BCM_REFERENCE(osh) 238*4882a593Smuzhiyun #endif // endif 239*4882a593Smuzhiyun #ifndef PKTRESETRXFRAG 240*4882a593Smuzhiyun #define PKTRESETRXFRAG(osh, lb) BCM_REFERENCE(osh) 241*4882a593Smuzhiyun #endif // endif 242*4882a593Smuzhiyun 243*4882a593Smuzhiyun /* TX FRAG */ 244*4882a593Smuzhiyun #ifndef PKTISTXFRAG 245*4882a593Smuzhiyun #define PKTISTXFRAG(osh, lb) (0) 246*4882a593Smuzhiyun #endif // endif 247*4882a593Smuzhiyun #ifndef PKTSETTXFRAG 248*4882a593Smuzhiyun #define PKTSETTXFRAG(osh, lb) BCM_REFERENCE(osh) 249*4882a593Smuzhiyun #endif // endif 250*4882a593Smuzhiyun 251*4882a593Smuzhiyun /* Need Rx completion used for AMPDU reordering */ 252*4882a593Smuzhiyun #ifndef PKTNEEDRXCPL 253*4882a593Smuzhiyun #define PKTNEEDRXCPL(osh, lb) (TRUE) 254*4882a593Smuzhiyun #endif // endif 255*4882a593Smuzhiyun #ifndef PKTSETNORXCPL 256*4882a593Smuzhiyun #define PKTSETNORXCPL(osh, lb) BCM_REFERENCE(osh) 257*4882a593Smuzhiyun #endif // endif 258*4882a593Smuzhiyun #ifndef PKTRESETNORXCPL 259*4882a593Smuzhiyun #define PKTRESETNORXCPL(osh, lb) BCM_REFERENCE(osh) 260*4882a593Smuzhiyun #endif // endif 261*4882a593Smuzhiyun #ifndef PKTISFRAG 262*4882a593Smuzhiyun #define PKTISFRAG(osh, lb) (0) 263*4882a593Smuzhiyun #endif // endif 264*4882a593Smuzhiyun #ifndef PKTFRAGISCHAINED 265*4882a593Smuzhiyun #define PKTFRAGISCHAINED(osh, i) (0) 266*4882a593Smuzhiyun #endif // endif 267*4882a593Smuzhiyun /* TRIM Tail bytes from lfrag */ 268*4882a593Smuzhiyun #ifndef PKTFRAG_TRIM_TAILBYTES 269*4882a593Smuzhiyun #define PKTFRAG_TRIM_TAILBYTES(osh, p, len, type) PKTSETLEN(osh, p, PKTLEN(osh, p) - len) 270*4882a593Smuzhiyun #endif // endif 271*4882a593Smuzhiyun #ifndef PKTISHDRCONVTD 272*4882a593Smuzhiyun #define PKTISHDRCONVTD(osh, lb) (0) 273*4882a593Smuzhiyun #endif // endif 274*4882a593Smuzhiyun 275*4882a593Smuzhiyun /* Forwarded pkt indication */ 276*4882a593Smuzhiyun #ifndef PKTISFRWDPKT 277*4882a593Smuzhiyun #define PKTISFRWDPKT(osh, lb) 0 278*4882a593Smuzhiyun #endif // endif 279*4882a593Smuzhiyun #ifndef PKTSETFRWDPKT 280*4882a593Smuzhiyun #define PKTSETFRWDPKT(osh, lb) BCM_REFERENCE(osh) 281*4882a593Smuzhiyun #endif // endif 282*4882a593Smuzhiyun #ifndef PKTRESETFRWDPKT 283*4882a593Smuzhiyun #define PKTRESETFRWDPKT(osh, lb) BCM_REFERENCE(osh) 284*4882a593Smuzhiyun #endif // endif 285*4882a593Smuzhiyun 286*4882a593Smuzhiyun /* SFD Frame */ 287*4882a593Smuzhiyun #ifndef PKTISSFDFRAME 288*4882a593Smuzhiyun #define PKTISSFDFRAME(osh, lb) (0) 289*4882a593Smuzhiyun #endif // endif 290*4882a593Smuzhiyun #ifndef PKTSETSFDFRAME 291*4882a593Smuzhiyun #define PKTSETSFDFRAME(osh, lb) BCM_REFERENCE(osh) 292*4882a593Smuzhiyun #endif // endif 293*4882a593Smuzhiyun #ifndef PKTRESETSFDFRAME 294*4882a593Smuzhiyun #define PKTRESETSFDFRAME(osh, lb) BCM_REFERENCE(osh) 295*4882a593Smuzhiyun #endif // endif 296*4882a593Smuzhiyun #ifndef PKTISSFDTXC 297*4882a593Smuzhiyun #define PKTISSFDTXC(osh, lb) (0) 298*4882a593Smuzhiyun #endif // endif 299*4882a593Smuzhiyun #ifndef PKTSETSFDTXC 300*4882a593Smuzhiyun #define PKTSETSFDTXC(osh, lb) BCM_REFERENCE(osh) 301*4882a593Smuzhiyun #endif // endif 302*4882a593Smuzhiyun #ifndef PKTRESETSFDTXC 303*4882a593Smuzhiyun #define PKTRESETSFDTXC(osh, lb) BCM_REFERENCE(osh) 304*4882a593Smuzhiyun #endif // endif 305*4882a593Smuzhiyun 306*4882a593Smuzhiyun #ifdef BCM_SECURE_DMA 307*4882a593Smuzhiyun #define SECURE_DMA_ENAB(osh) (1) 308*4882a593Smuzhiyun #else 309*4882a593Smuzhiyun 310*4882a593Smuzhiyun #define SECURE_DMA_ENAB(osh) (0) 311*4882a593Smuzhiyun #ifndef BCMDMA64OSL 312*4882a593Smuzhiyun #define SECURE_DMA_MAP(osh, va, size, direction, p, dmah, pcma, offset) ((dmaaddr_t) ((0))) 313*4882a593Smuzhiyun #else 314*4882a593Smuzhiyun #define SECURE_DMA_MAP(osh, va, size, direction, p, dmah, pcma, offset) \ 315*4882a593Smuzhiyun ((dmaaddr_t) {.hiaddr = 0, .loaddr = 0}) 316*4882a593Smuzhiyun #endif // endif 317*4882a593Smuzhiyun #define SECURE_DMA_DD_MAP(osh, va, size, direction, p, dmah) 0 318*4882a593Smuzhiyun #ifndef BCMDMA64OSL 319*4882a593Smuzhiyun #define SECURE_DMA_MAP_TXMETA(osh, va, size, direction, p, dmah, pcma) ((dmaaddr_t) ((0))) 320*4882a593Smuzhiyun #else 321*4882a593Smuzhiyun #define SECURE_DMA_MAP_TXMETA(osh, va, size, direction, p, dmah, pcma) \ 322*4882a593Smuzhiyun ((dmaaddr_t) {.hiaddr = 0, .loaddr = 0}) 323*4882a593Smuzhiyun #endif // endif 324*4882a593Smuzhiyun #define SECURE_DMA_UNMAP(osh, pa, size, direction, p, dmah, pcma, offset) 325*4882a593Smuzhiyun #define SECURE_DMA_UNMAP_ALL(osh, pcma) 326*4882a593Smuzhiyun 327*4882a593Smuzhiyun #endif /* BCMDMA64OSL */ 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun #ifndef ROMMABLE_ASSERT 330*4882a593Smuzhiyun #define ROMMABLE_ASSERT(exp) ASSERT(exp) 331*4882a593Smuzhiyun #endif /* ROMMABLE_ASSERT */ 332*4882a593Smuzhiyun 333*4882a593Smuzhiyun #ifndef MALLOC_NOPERSIST 334*4882a593Smuzhiyun #define MALLOC_NOPERSIST MALLOC 335*4882a593Smuzhiyun #endif /* !MALLOC_NOPERSIST */ 336*4882a593Smuzhiyun 337*4882a593Smuzhiyun #ifndef MALLOC_PERSIST 338*4882a593Smuzhiyun #define MALLOC_PERSIST MALLOC 339*4882a593Smuzhiyun #endif /* !MALLOC_PERSIST */ 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun #ifndef MALLOC_NOPERSIST 342*4882a593Smuzhiyun #define MALLOC_NOPERSIST MALLOC 343*4882a593Smuzhiyun #endif /* !MALLOC_NOPERSIST */ 344*4882a593Smuzhiyun 345*4882a593Smuzhiyun #ifndef MALLOC_PERSIST_ATTACH 346*4882a593Smuzhiyun #define MALLOC_PERSIST_ATTACH MALLOC 347*4882a593Smuzhiyun #endif /* !MALLOC_PERSIST_ATTACH */ 348*4882a593Smuzhiyun 349*4882a593Smuzhiyun #ifndef MALLOCZ_PERSIST_ATTACH 350*4882a593Smuzhiyun #define MALLOCZ_PERSIST_ATTACH MALLOCZ 351*4882a593Smuzhiyun #endif /* !MALLOCZ_PERSIST_ATTACH */ 352*4882a593Smuzhiyun 353*4882a593Smuzhiyun #ifndef MALLOCZ_NOPERSIST 354*4882a593Smuzhiyun #define MALLOCZ_NOPERSIST MALLOCZ 355*4882a593Smuzhiyun #endif /* !MALLOCZ_NOPERSIST */ 356*4882a593Smuzhiyun 357*4882a593Smuzhiyun #ifndef MALLOCZ_PERSIST 358*4882a593Smuzhiyun #define MALLOCZ_PERSIST MALLOCZ 359*4882a593Smuzhiyun #endif /* !MALLOCZ_PERSIST */ 360*4882a593Smuzhiyun 361*4882a593Smuzhiyun #ifndef MFREE_PERSIST 362*4882a593Smuzhiyun #define MFREE_PERSIST MFREE 363*4882a593Smuzhiyun #endif /* !MFREE_PERSIST */ 364*4882a593Smuzhiyun 365*4882a593Smuzhiyun #ifndef MALLOC_SET_NOPERSIST 366*4882a593Smuzhiyun #define MALLOC_SET_NOPERSIST(osh) do { } while (0) 367*4882a593Smuzhiyun #endif /* !MALLOC_SET_NOPERSIST */ 368*4882a593Smuzhiyun 369*4882a593Smuzhiyun #ifndef MALLOC_CLEAR_NOPERSIST 370*4882a593Smuzhiyun #define MALLOC_CLEAR_NOPERSIST(osh) do { } while (0) 371*4882a593Smuzhiyun #endif /* !MALLOC_CLEAR_NOPERSIST */ 372*4882a593Smuzhiyun 373*4882a593Smuzhiyun #if defined(OSL_MEMCHECK) 374*4882a593Smuzhiyun #define MEMCHECK(f, l) osl_memcheck(f, l) 375*4882a593Smuzhiyun #else 376*4882a593Smuzhiyun #define MEMCHECK(f, l) 377*4882a593Smuzhiyun #endif /* OSL_MEMCHECK */ 378*4882a593Smuzhiyun 379*4882a593Smuzhiyun #endif /* _osl_h_ */ 380