staging: unisys: fix copyright notices
[cascardo/linux.git] / drivers / staging / unisys / include / timskmodutils.h
1 /* timskmodutils.h
2  *
3  * Copyright (C) 2010 - 2013 UNISYS CORPORATION
4  * All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or (at
9  * your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14  * NON INFRINGEMENT.  See the GNU General Public License for more
15  * details.
16  */
17
18 #ifndef __TIMSKMODUTILS_H__
19 #define __TIMSKMODUTILS_H__
20
21 #include "timskmod.h"
22
23 void *kmalloc_kernel(size_t siz);
24 void  myprintk(const char *myDrvName, const char *devname,
25                 const char *template, ...);
26
27 /*--------------------------------*
28  *---  GENERAL MESSAGEQ STUFF  ---*
29  *--------------------------------*/
30
31 struct MessageQEntry;
32
33 /** the data structure used to hold an arbitrary data item that you want
34  *  to place on a #MESSAGEQ.  Declare and initialize as follows:
35  *
36  *  This structure should be considered opaque; the client using it should
37  *  never access the fields directly.
38  *  Refer to these functions for more info:
39  *
40  *  @ingroup messageq
41  */
42 typedef struct MessageQEntry {
43         void *data;
44         struct MessageQEntry *qNext;
45         struct MessageQEntry *qPrev;
46 } MESSAGEQENTRY;
47
48 /** the data structure used to hold a FIFO queue of #MESSAGEQENTRY<b></b>s.
49  *  Declare and initialize as follows:
50  *  @code
51  *      MESSAGEQ myQueue;
52  *  @endcode
53  *  This structure should be considered opaque; the client using it should
54  *  never access the fields directly.
55  *  Refer to these functions for more info:
56  *
57  *  @ingroup messageq
58  */
59 typedef struct MessageQ {
60         MESSAGEQENTRY *qHead;
61         MESSAGEQENTRY *qTail;
62         struct semaphore nQEntries;
63         spinlock_t       queueLock;
64 } MESSAGEQ;
65
66 char *cyclesToSeconds(u64 cycles, u64 cyclesPerSecond,
67                       char *buf, size_t bufsize);
68 char *cyclesToIterationSeconds(u64 cycles, u64 cyclesPerSecond,
69                                u64 iterations, char *buf, size_t bufsize);
70 char *cyclesToSomethingsPerSecond(u64 cycles, u64 cyclesPerSecond,
71                                   u64 somethings, char *buf, size_t bufsize);
72 struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size);
73 void visor_seq_file_done_buffer(struct seq_file *m);
74
75 #endif