3 * Copyright (C) 2010 - 2013 UNISYS CORPORATION
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.
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
18 #ifndef __TIMSKMODUTILS_H__
19 #define __TIMSKMODUTILS_H__
23 void *kmalloc_kernel(size_t siz);
24 void myprintk(const char *myDrvName, const char *devname,
25 const char *template, ...);
27 /*--------------------------------*
28 *--- GENERAL MESSAGEQ STUFF ---*
29 *--------------------------------*/
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:
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:
42 typedef struct MessageQEntry {
44 struct MessageQEntry *qNext;
45 struct MessageQEntry *qPrev;
48 /** the data structure used to hold a FIFO queue of #MESSAGEQENTRY<b></b>s.
49 * Declare and initialize as follows:
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:
59 typedef struct MessageQ {
62 struct semaphore nQEntries;
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);