From owner-svn-src-projects@FreeBSD.ORG Sat Feb 15 16:17:38 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0799E14; Sat, 15 Feb 2014 16:17:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCBD013C7; Sat, 15 Feb 2014 16:17:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1FGHce0091953; Sat, 15 Feb 2014 16:17:38 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1FGHcQx091952; Sat, 15 Feb 2014 16:17:38 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201402151617.s1FGHcQx091952@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Feb 2014 16:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r261935 - projects/arm64/sys/boot/efi/libefi X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Feb 2014 16:17:39 -0000 Author: andrew Date: Sat Feb 15 16:17:38 2014 New Revision: 261935 URL: http://svnweb.freebsd.org/changeset/base/261935 Log: Implement seek for the EFI Simple FS Modified: projects/arm64/sys/boot/efi/libefi/efisimplefs.c Modified: projects/arm64/sys/boot/efi/libefi/efisimplefs.c ============================================================================== --- projects/arm64/sys/boot/efi/libefi/efisimplefs.c Sat Feb 15 14:56:50 2014 (r261934) +++ projects/arm64/sys/boot/efi/libefi/efisimplefs.c Sat Feb 15 16:17:38 2014 (r261935) @@ -165,9 +165,35 @@ efifs_write(struct open_file *f, void *b static off_t efifs_seek(struct open_file *f, off_t offset, int where) { - printf("efifs_seek\n"); + EFI_STATUS status; + EFI_FILE *file; + uint64_t pos; + + file = f->f_fsdata; + if (file == NULL) + return (-1); + + switch(where) { + case SEEK_SET: + pos = 0; + break; + case SEEK_CUR: + /* Read the current position first */ + status = file->GetPosition(file, &pos); + if (EFI_ERROR(status)) + return (-1); + break; + case SEEK_END: + default: + return (-1); + } + + pos += offset; + status = file->SetPosition(file, pos); + if (EFI_ERROR(status)) + return (-1); - return (EINVAL); + return (pos); } static int