]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/include/aml.h
ssh: document thumbfile options
[plan9front.git] / sys / include / aml.h
index e1cd9c33536c4a9c9042aefcbf0fd334350e43fc..27c31d003457c93d0251c93c7b778af180541bb4 100644 (file)
@@ -4,6 +4,7 @@
 /*
  *     b       uchar*  buffer          amllen() returns number of bytes
  *     s       char*   string          amllen() is strlen()
+ *     n       char*   undefined name  amllen() is strlen()
  *     i       uvlong* integer
  *     p       void**  package         amllen() is # of elements
  *     r       void*   region
@@ -17,6 +18,8 @@ void*         amlval(void *);
 uvlong         amlint(void *);
 int            amllen(void *);
 
+void*          amlnew(char tag, int len);
+
 void           amlinit(void);
 void           amlexit(void);
 
@@ -25,8 +28,15 @@ void*                amlwalk(void *dot, char *name);
 int            amleval(void *dot, char *fmt, ...);
 void           amlenum(void *dot, char *seg, int (*proc)(void *, void *), void *arg);
 
+/*
+ * exclude from garbage collection
+ */
+void           amltake(void *);
+void           amldrop(void *);
+
 void*          amlroot;
 int            amldebug;
+uvlong         amlintmask;
 
 #pragma        varargck        type    "V"     void*
 #pragma        varargck        type    "N"     void*
@@ -34,3 +44,33 @@ int          amldebug;
 /* to be provided by operating system */
 extern void*   amlalloc(int);
 extern void    amlfree(void*);
+
+extern void    amldelay(int);  /* microseconds */
+
+enum {
+       MemSpace        = 0x00,
+       IoSpace         = 0x01,
+       PcicfgSpace     = 0x02,
+       EbctlSpace      = 0x03,
+       SmbusSpace      = 0x04,
+       CmosSpace       = 0x05,
+       PcibarSpace     = 0x06,
+       IpmiSpace       = 0x07,
+};
+
+typedef struct Amlio Amlio;
+struct Amlio
+{
+       int     space;
+       uvlong  off;
+       uvlong  len;
+       void    *name;
+       uchar   *va;
+
+       void    *aux;
+       int     (*read)(Amlio *io, void *data, int len, int off);
+       int     (*write)(Amlio *io, void *data, int len, int off);
+};
+
+extern int     amlmapio(Amlio *io);
+extern void    amlunmapio(Amlio *io);