]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLibPrivateInternalFiles/Include/kfile.h
SecurityPkg: Add TPM PTP support in TPM2 device lib.
[mirror_edk2.git] / StdLibPrivateInternalFiles / Include / kfile.h
index 6e7d1b4c79821d72119ae70566a9f59832f97939..67bff56cc67483b6e7eaa1b2ba50b728942bf3d3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The EFI kernel's interpretation of a "file".\r
 \r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
   distribution.  The full text of the license may be found at\r
@@ -82,8 +82,16 @@ struct _Device_Node;
 struct __filedes {\r
   off_t                   f_offset;     /* current position in file */\r
   const struct fileops   *f_ops;\r
+\r
+  /*  The devdata member has different meanings depending upon whether\r
+      a block oriented or character oriented device is being accessed.\r
+      For block devices, devdata holds an EFI handle to the open file or directory.\r
+      For character devices, devdata points to the device's IIO structure,\r
+      if it has one.  It may be NULL indicating a non-interactive character\r
+      device.\r
+  */\r
   void                   *devdata;      /* Device-specific data */\r
-  int                     Oflags;       // From the open call\r
+  int                     Oflags;       // From the open call, see fcntl.h\r
   int                     Omode;        // From the open call\r
   int                     RefCount;     // Reference count of opens\r
   UINT32                  f_flag;       /* see fcntl.h */\r
@@ -94,7 +102,13 @@ struct __filedes {
 \r
 struct fileops {\r
   /* These functions must always be implemented. */\r
+\r
+  /** Perform device specific operations for closing the device.\r
+      It is the responsibility of this function to flush or discard\r
+      buffer contents.\r
+  **/\r
   int     (EFIAPI *fo_close)    (struct __filedes *filp);\r
+\r
   ssize_t (EFIAPI *fo_read)     (struct __filedes *filp, off_t *Offset, size_t Len, void *Buf);\r
   ssize_t (EFIAPI *fo_write)    (struct __filedes *filp, off_t *Offset, size_t Len, const void *Buf);\r
 \r
@@ -115,7 +129,7 @@ struct fileops {
   off_t   (EFIAPI *fo_lseek)    (struct __filedes *filp, off_t, int);\r
 };\r
 \r
-/*  A generic instance structure which is valid for\r
+/*  A generic instance structure which is valid\r
     for all device instance structures.\r
 \r
     All device instance structures MUST be a multiple of 8-bytes in length.\r