aboutsummaryrefslogtreecommitdiffstats
path: root/util/alevt/cache.h
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2010-02-25 21:13:46 +1100
committeretobi <git@e-tobi.net>2013-09-03 09:48:46 +0200
commit665818f1969f893f05edf5b70eb1804c89b2829e (patch)
tree34ba68cee03c52d769a5a51b456b7e9d63cd091a /util/alevt/cache.h
parent109c7947d6a11a2a54eff1b19615ed80ea2f0602 (diff)
parent9fe4d4ea9c054e539ab679ed2e9c076c35beb69d (diff)
downloadlinux-dvb-apps-665818f1969f893f05edf5b70eb1804c89b2829e.tar.gz
Imported Debian patch 1.1.1+rev1355-1debian/1.1.1+rev1355-1
Diffstat (limited to 'util/alevt/cache.h')
-rw-r--r--util/alevt/cache.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/util/alevt/cache.h b/util/alevt/cache.h
new file mode 100644
index 0000000..934ef9a
--- /dev/null
+++ b/util/alevt/cache.h
@@ -0,0 +1,41 @@
+#ifndef CACHE_H
+#define CACHE_H
+
+#include "vt.h"
+#include "misc.h"
+#include "dllist.h"
+
+#define HASH_SIZE 113
+
+
+struct cache
+{
+ struct dl_head hash[HASH_SIZE];
+ int erc; // error reduction circuit on
+ int npages;
+ u16 hi_subno[0x9ff + 1]; // 0:pg not in cache, 1-3f80:highest subno + 1
+ struct cache_ops *op;
+};
+
+
+struct cache_page
+{
+ struct dl_node node[1];
+ struct vt_page page[1];
+};
+
+
+struct cache_ops
+{
+ void (*close)(struct cache *ca);
+ struct vt_page *(*get)(struct cache *ca, int pgno, int subno);
+ struct vt_page *(*put)(struct cache *ca, struct vt_page *vtp);
+ void (*reset)(struct cache *ca);
+ struct vt_page *(*foreach_pg)(struct cache *ca, int pgno, int subno, int dir,
+ int (*func)(), void *data);
+ int (*mode)(struct cache *ca, int mode, int arg);
+};
+
+struct cache *cache_open(void);
+#define CACHE_MODE_ERC 1
+#endif