search for: lfree

Displaying 19 results from an estimated 19 matches for "lfree".

Did you mean: free
2013 Sep 06
2
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...if (!eparam) + return -1; + memset(&inreg, 0, sizeof inreg); inreg.eax.b[1] = 0x48; inreg.edx.b[0] = disk; @@ -153,7 +153,8 @@ int disk_get_params(int disk, struct disk_info *const diskinfo) diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; out: - lfree(eparam); + if (eparam) + lfree(eparam); return rv; } -- 1.7.2.5
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...e botch s/pxe_dns/pxe_dns_resolv/ com32: Add missing DHCP pack/unpack files elflink: Fix compiler warning fs: Add .copy_super to struct fs_ops com32: Per-object file LDFLAGS Revert "pxe: resolve names via DNS from protected-mode code" ldlinux: Don't lfree() 'kernel' twice module: Make list of DT_NEEDED entries per-module com32/chain/utility.c | 24 +++++--- com32/cmenu/Makefile | 17 +++++- com32/cmenu/libmenu/syslnx.c | 25 ++++++-- com32/elflink/...
2011 Jan 03
1
[PATCH] COM32R documentation: fix typo 'pm_cs'
...doc/comboot.txt +++ b/doc/comboot.txt @@ -986,27 +986,27 @@ AX=0024h [3.80] Cleanup, shuffle and boot, raw version ++++ 32-BIT ONLY API CALLS ++++ -void *pm_cs->lmalloc(size_t bytes) +void *cs_pm->lmalloc(size_t bytes) Allocate a buffer in low memory (below 1 MB). -void pm_cs->lfree(void *ptr) +void cs_pm->lfree(void *ptr) - Free a buffer allocated with pm_cs->lmalloc(). + Free a buffer allocated with cs_pm->lmalloc(). -DIR *pm_cs->opendir(const char *pathname) +DIR *cs_pm->opendir(const char *pathname) Open a directory. -struct dirent *pm_cs->rea...
2013 Sep 17
2
[PATCH 1/4 v2] com32/lib/: Avoid unneeded allocation.
eparam would only be used if EBIOS is available. If it is not, then there is no reason to allocate eparam. Signed-off-by: Raphael S.Carvalho <raphael.scarv at gmail.com> --- com32/lib/syslinux/disk.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c index 093751a..d96acbf 100644 ---
2013 Sep 06
1
[PATCH 2/2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...t;disk; - inreg.ebx.w[0] = OFFS(buf); - inreg.es = SEG(buf); - } - if (disk_int13_retry(&inreg, NULL)) goto out; @@ -234,7 +277,6 @@ void *disk_read_sectors(const struct disk_info *const diskinfo, uint64_t lba, if (data) memcpy(data, buf, count * diskinfo->bps); out: - lfree(dapa); lfree(buf); return data; } @@ -255,7 +297,6 @@ int disk_write_sectors(const struct disk_info *const diskinfo, uint64_t lba, const void *data, uint8_t count) { com32sys_t inreg; - struct disk_ebios_dapa *dapa; void *buf; uint32_t maxcnt; uint32_t s...
2013 Sep 17
0
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...memset(&inreg, 0, sizeof inreg); > inreg.eax.b[1] = 0x48; > inreg.edx.b[0] = disk; > @@ -153,7 +153,8 @@ int disk_get_params(int disk, struct disk_info *const diskinfo) > diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; > > out: > - lfree(eparam); > + if (eparam) > + lfree(eparam); > return rv; > } You actually don't need to check for 'eparam' being NULL, lfree() can handle being called with a NULL pointer. -- Matt Fleming, Intel Open Source Technology Center
2013 Sep 17
1
[PATCH 2/4 v3] com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.
...gt;disk; - inreg.ebx.w[0] = OFFS(buf); - inreg.es = SEG(buf); - } - if (disk_int13_retry(&inreg, NULL)) goto out; @@ -233,7 +276,6 @@ void *disk_read_sectors(const struct disk_info *const diskinfo, uint64_t lba, if (data) memcpy(data, buf, count * diskinfo->bps); out: - lfree(dapa); lfree(buf); return data; } @@ -254,7 +296,6 @@ int disk_write_sectors(const struct disk_info *const diskinfo, uint64_t lba, const void *data, uint8_t count) { com32sys_t inreg; - struct disk_ebios_dapa *dapa; void *buf; uint32_t maxcnt; uint32_t s...
2011 Feb 16
1
[PATCH] [RESEND] COM32R documentation: fix typo 'pm_cs'
...doc/comboot.txt +++ b/doc/comboot.txt @@ -986,27 +986,27 @@ AX=0024h [3.80] Cleanup, shuffle and boot, raw version ++++ 32-BIT ONLY API CALLS ++++ -void *pm_cs->lmalloc(size_t bytes) +void *cs_pm->lmalloc(size_t bytes) Allocate a buffer in low memory (below 1 MB). -void pm_cs->lfree(void *ptr) +void cs_pm->lfree(void *ptr) - Free a buffer allocated with pm_cs->lmalloc(). + Free a buffer allocated with cs_pm->lmalloc(). -DIR *pm_cs->opendir(const char *pathname) +DIR *cs_pm->opendir(const char *pathname) Open a directory. -struct dirent *pm_cs->rea...
2013 Sep 30
0
[PATCH 1/4 v2] com32/lib/: Avoid unneeded allocation.
...nded disk parameters if ebios == 1 */ > if (diskinfo->ebios) { > + eparam = lmalloc(sizeof *eparam); > + if (!eparam) > + return -1; > + > memset(&inreg, 0, sizeof inreg); > inreg.eax.b[1] = 0x48; > inreg.edx.b[0] = disk; It would be better to move the lfree(), and in fact the declaration of 'eparam' under... if (diskbios->ebios) { struct disk_ebios_eparam *eparam; eparam = lmalloc(); ... lfree(eparam); } since it's not used anywhere else. Make sense? -- Matt Fleming, Intel Open Source Technology Center
2013 Sep 06
1
[PATCH 2/2 v2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...t;disk; - inreg.ebx.w[0] = OFFS(buf); - inreg.es = SEG(buf); - } - if (disk_int13_retry(&inreg, NULL)) goto out; @@ -234,7 +277,6 @@ void *disk_read_sectors(const struct disk_info *const diskinfo, uint64_t lba, if (data) memcpy(data, buf, count * diskinfo->bps); out: - lfree(dapa); lfree(buf); return data; } @@ -255,67 +297,34 @@ int disk_write_sectors(const struct disk_info *const diskinfo, uint64_t lba, const void *data, uint8_t count) { com32sys_t inreg; - struct disk_ebios_dapa *dapa; void *buf; - uint32_t maxcnt; + uint32_t...
2012 Apr 17
2
[GIT PULL] elflink warning fixes and auto extension support
...ux: Add prototype for new_linux_kernel() ldlinux: Fix uninitialized variable warning ldlinux: Use signed char consistently core: Move write_serial() prototype to core.h ldlinux: Include write_serial() prototype meminfo: If we allocate with lmalloc() we should free with lfree() localboot: Include header files for function prototypes init: Fix up compiler warnings hello: Delete unused variable 'console_init' writestr: Include core.h for writechr() prototype font: Cast away compiler warning graphics: Fix GXPix* assignment...
2015 Sep 24
0
[PATCH] com32/disk: add UEFI support
...2)); - - if (diskinfo->spt) - diskinfo->cbios = 1; /* Valid geometry */ - else { - diskinfo->head = 1; - diskinfo->spt = 1; - diskinfo->cyl = 1; - } - - if (!diskinfo->lbacnt) - diskinfo->lbacnt = diskinfo->cyl * diskinfo->head * diskinfo->spt; - -out: - lfree(eparam); - return rv; -} - -/** - * Fill inreg based on EBIOS addressing properties. - * - * @v diskinfo The disk drive to read from - * @v inreg Register data structure to be filled. - * @v lba The logical block address to begin reading at - * @v count The number of sectors to read - *...
2012 Aug 20
13
[PATCH 00/12] Multidisk support
Hello, the following patches should get multidisk access working. The syntax accepted is the following: (hdx,y)/path/to/file where x is the disk number and start at 0 and the y is the partition number starting at 1. So (hd0,1) is the first partition of the first disk. the other accepted syntax is using MBR's 32 bits disk signature so for example: (mbr:0x12345678,2)/foo/bar would address
2012 Jul 16
5
[PATCH 0/5] Deleting __intcall() from Syslinux
From: Matt Fleming <matt.fleming at intel.com> Since we can't use __intcall() for EFI, and since we can now have the ELF module code resolve all our symbols at runtime, we should delete as many references to __intcall() as possible and just access the symbols directly. The most interesting patch is the support for weak symbols. We need to be able to reference derivative-specific
2012 Aug 14
1
[GIT PULL] elflink fixes
...ze); + lba = *((uint32_t *) MK_PTR(0, fd.handle)); /* Call comapi_close() to free the structure */ - inregs.eax.w[0] = 0x0008; - inregs.esi.w[0] = OFFS(buf); - inregs.es = SEG(buf); - __com32.cs_intcall(0x22, &inregs, &inregs); + close_file(fd.handle); fail: lfree(buf); diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile index c6e0cae..beb8dd2 100644 --- a/com32/cmenu/Makefile +++ b/com32/cmenu/Makefile @@ -17,16 +17,16 @@ NOGPL := 1 +LIBS = libmenu/libmenu.c32 \ + $(com32)/libutil/libutil_com.c32 \ + $(com32)/lib/libcom32.c32 + top...
2013 Oct 18
0
[RFC/PATCH 1/3] Move partiter from com32/chain to com32/lib/syslinux
...open_file(buf, O_RDONLY, &fd) <= 0) { - goto fail; /* Filename not found */ - } - - /* Since the first member is the LBA, we simply cast */ - lba = *((uint32_t *) MK_PTR(0, fd.handle)); - - /* Call comapi_close() to free the structure */ - close_file(fd.handle); - -fail: - lfree(buf); - return lba; -} - -/* drive offset detection */ -int drvoff_detect(int type) -{ - if (bpbV40 <= type && type <= bpbVNT) { - return 0x24; - } else if (type == bpbV70) { - return 0x40; - } else if (type == bpbEXF) { - return 0x6F; - } - - return -1; -} - -/* - *...
2015 Jul 22
0
[PULL 1/8] Move partiter from com32/chain to com32/lib/syslinux
...open_file(buf, O_RDONLY, &fd) <= 0) { - goto fail; /* Filename not found */ - } - - /* Since the first member is the LBA, we simply cast */ - lba = *((uint32_t *) MK_PTR(0, fd.handle)); - - /* Call comapi_close() to free the structure */ - close_file(fd.handle); - -fail: - lfree(buf); - return lba; -} - -/* drive offset detection */ -int drvoff_detect(int type) -{ - if (bpbV40 <= type && type <= bpbVNT) { - return 0x24; - } else if (type == bpbV70) { - return 0x40; - } else if (type == bpbEXF) { - return 0x6F; - } - - return -1; -} - -/* - *...
2012 Mar 23
19
[PATCH 00/19][elflink] Improve compatibility with 4.x
From: Matt Fleming <matt.fleming at intel.com> The following patch series is available at, git://git.zytor.com/users/mfleming/syslinux.git elflink All patches are against the 'elflink' branch. This series fixes a few serious bugs and some behavioural incompatibilities with the 4.x series. Matt Fleming (19): ldlinux: Initialise 'p' before using it. ldlinux: Parse
2015 Jul 22
13
[PULL 0/8] MultiFS suppport for BIOS and EFI
So last week I was wondering if XFS was still working -- even with its last on-disk structure changes -- and it _suprisingly_ worked as expected. Right, now I can finally get rid of GRUB and use Syslinux to boot my Linux on EFI from a rootfs with xfs. Shit, I have two partitions (the first one being the required ESP) so there is no way to access the other partitions since because Syslinux does not