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