CD exfat support for Tomato. https://github.com/dorimanx/exfat-nofuse.
[tomato.git] / release / src-rt / linux / linux-2.6 / fs / exfat / exfat_oal.h
blobca3f956eeadcc88618063ceabaeae4d3328a8ace
1 /*
2 * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 /************************************************************************/
20 /* */
21 /* PROJECT : exFAT & FAT12/16/32 File System */
22 /* FILE : exfat_oal.h */
23 /* PURPOSE : Header File for exFAT OS Adaptation Layer */
24 /* (Semaphore Functions & Real-Time Clock Functions) */
25 /* */
26 /*----------------------------------------------------------------------*/
27 /* NOTES */
28 /* */
29 /*----------------------------------------------------------------------*/
30 /* REVISION HISTORY (Ver 0.9) */
31 /* */
32 /* - 2010.11.15 [Joosun Hahn] : first writing */
33 /* */
34 /************************************************************************/
36 #ifndef _EXFAT_OAL_H
37 #define _EXFAT_OAL_H
39 #include "exfat_config.h"
40 #include "exfat_global.h"
41 #include <linux/version.h>
43 #ifdef __cplusplus
44 extern "C" {
45 #endif /* __cplusplus */
47 /*----------------------------------------------------------------------*/
48 /* Constant & Macro Definitions (Configurable) */
49 /*----------------------------------------------------------------------*/
51 /*----------------------------------------------------------------------*/
52 /* Constant & Macro Definitions (Non-Configurable) */
53 /*----------------------------------------------------------------------*/
55 /*----------------------------------------------------------------------*/
56 /* Type Definitions */
57 /*----------------------------------------------------------------------*/
59 typedef struct {
60 UINT16 sec; /* 0 ~ 59 */
61 UINT16 min; /* 0 ~ 59 */
62 UINT16 hour; /* 0 ~ 23 */
63 UINT16 day; /* 1 ~ 31 */
64 UINT16 mon; /* 1 ~ 12 */
65 UINT16 year; /* 0 ~ 127 (since 1980) */
66 } TIMESTAMP_T;
68 /*----------------------------------------------------------------------*/
69 /* External Function Declarations */
70 /*----------------------------------------------------------------------*/
72 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
73 #define DECLARE_MUTEX(m) DEFINE_SEMAPHORE(m)
74 #endif
76 INT32 sm_init(struct semaphore *sm);
77 INT32 sm_P(struct semaphore *sm);
78 void sm_V(struct semaphore *sm);
80 TIMESTAMP_T *tm_current(TIMESTAMP_T *tm);
82 #ifdef __cplusplus
84 #endif /* __cplusplus */
86 #endif /* _EXFAT_OAL_H */
88 /* end of exfat_oal.h */