search for: inreg

Displaying 20 results from an estimated 102 matches for "inreg".

2013 Sep 06
1
[PATCH 2/2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...t;ops.write_code = EBIOS_WRITE_CODE; + } else { + diskinfo->ops.disk_op = &chs_disk_op; + diskinfo->ops.read_code = CHS_READ_CODE; + diskinfo->ops.write_code = CHS_WRITE_CODE; } /* Get extended disk parameters if ebios == 1 */ @@ -159,6 +167,79 @@ out: } /** + * 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 + * @ret lmalloc'd buf upon success, NULL upon...
2013 Sep 17
1
[PATCH 2/4 v3] com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.
...ex d96acbf..b3b9129 100644 --- a/com32/lib/syslinux/disk.c +++ b/com32/lib/syslinux/disk.c @@ -33,6 +33,7 @@ * Deal with disks and partitions */ +#include <core.h> #include <dprintf.h> #include <stdio.h> #include <stdlib.h> @@ -158,6 +159,83 @@ out: } /** + * 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 + * @v op_code Code to write/read operation + * @ret...
2013 Sep 06
1
[PATCH 2/2 v2] com32/disk: Improve flow at disk_write_sectors and disk_read_sectors.
...rporation; author: H. Peter Anvin * Copyright (C) 2010 Shao Miller + * Copyright (C) 2013 Raphael S. Carvalho * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -159,6 +160,81 @@ out: } /** + * 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 + * @ret lmalloc'd buf upon success, NULL upon...
2003 Sep 15
2
Can not use read file SYSLINUX API call
Hi Peter Anvin I tried to use open file and read file SYSLINUX API. But it always make my PC104 freeze. My snip code : ================================================ int __start(void) { int ax,cx,dx,es,si,di,t; com32sys_t inreg,outreg; memset(&inreg, 0, sizeof inreg); memset(&outreg, 0, sizeof outreg); strcopy(__com32.cs_bounce, "test.txt"); inreg.eax.w[0] = 0x0006; // Open file inreg.esi.w[0] = OFFS(__com32.cs_bounce); inreg.es = SEG(__com32.cs_bounce); __com32.cs_intcall(0x22, &inreg, &outreg...
2010 Apr 27
2
gpllib write_sectors() patch
...ot have to call get_drive_parameters every time so they should be supplied in the driveinfo struct (for both read and write). /** * write_sectors - write several sectors from disk @@ -37,9 +55,14 @@ int write_sectors(const struct driveinfo *drive_info, const unsigned int lba, { com32sys_t inreg, outreg; struct ebios_dapa *dapa = __com32.cs_bounce; - void *buf = (char *)__com32.cs_bounce + size; + void *buf = (char *)__com32.cs_bounce + size*SECTOR; - memcpy(buf, data, size); + if (get_drive_parameters(drive_info) == -1) { + printf("ERR: Can't get drive para...
2015 Sep 24
0
[PATCH] com32/disk: add UEFI support
...uf, const struct guid *const id); +extern int str_to_guid(const char *buf, struct guid *const id); +extern void disk_gpt_part_dump(const struct disk_gpt_part_entry *const + gpt_part); + +/* disk.c */ +#ifndef SYSLINUX_EFI extern int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg); +#endif + extern int disk_get_params(int disk, struct disk_info *const diskinfo); extern void *disk_read_sectors(const struct disk_info *const diskinfo, - uint64_t lba, uint8_t count); + uint64_t lba, uint8_t count); extern int disk_w...
2008 Jul 08
3
[LLVMdev] Inreg firstclass structs
Hi all, I've been discussing parameter attributes and their impact on first-class struct parameters. Duncan and I came to the conclusion that the only attribute that could be applied to structs currently, is the inreg attribute. However, since there is no support anywhere for that currently (transformation passes and backends?), it might be better to disallow the inreg attribute for struct parameters and return values for now. AFAICS, this would require modification to ParamAttr::typeIncompatible and the langre...
2008 Jul 08
0
[LLVMdev] Inreg firstclass structs
...AM, Matthijs Kooijman <matthijs at stdin.nl> wrote: > Hi all, > > I've been discussing parameter attributes and their impact on first-class > struct parameters. Duncan and I came to the conclusion that the only attribute > that could be applied to structs currently, is the inreg attribute. However, > since there is no support anywhere for that currently (transformation passes > and backends?), it might be better to disallow the inreg attribute for struct > parameters and return values for now. > > AFAICS, this would require modification to ParamAttr::typeInc...
2013 Sep 06
2
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...x/disk.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c index 093751a..554bed3 100644 --- a/com32/lib/syslinux/disk.c +++ b/com32/lib/syslinux/disk.c @@ -73,7 +73,7 @@ int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg) int disk_get_params(int disk, struct disk_info *const diskinfo) { static com32sys_t inreg, outreg; - struct disk_ebios_eparam *eparam; + struct disk_ebios_eparam *eparam = NULL; int rv = 0; memset(diskinfo, 0, sizeof *diskinfo); @@ -94,12 +94,12 @@ int...
2013 Sep 17
2
[PATCH 1/4 v2] com32/lib/: Avoid unneeded allocation.
...inux/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 --- a/com32/lib/syslinux/disk.c +++ b/com32/lib/syslinux/disk.c @@ -73,7 +73,7 @@ int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg) int disk_get_params(int disk, struct disk_info *const diskinfo) { static com32sys_t inreg, outreg; - struct disk_ebios_eparam *eparam; + struct disk_ebios_eparam *eparam = NULL; int rv = 0; memset(diskinfo, 0, sizeof *diskinfo); @@ -94,12 +94,12 @@ int...
2013 Feb 10
4
[PATCH] poweroff COM32 module
...ny later version; incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + +/* + * poweroff.c + * + * APM poweroff module + */ + +#include <stdio.h> +#include <string.h> +#include <com32.h> + +int main() +{ + com32sys_t inregs, outregs; + + memset(&inregs, 0, sizeof inregs); + + inregs.eax.l = 0x5300; /* APM Installation Check (00h) */ + inregs.ebx.l = 0; /* APM BIOS (0000h) */ + __intcall(0x15, &inregs, &outregs); + + if (outregs.eflags.l & EFLAGS_CF) { + printf("APM not present.\n"); + retu...
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...a/com32/chain/utility.c b/com32/chain/utility.c index fb59551..b54e0cd 100644 --- a/com32/chain/utility.c +++ b/com32/chain/utility.c @@ -94,24 +94,30 @@ void lba2chs(disk_chs *dst, const struct disk_info *di, uint64_t lba, uint32_t m uint32_t get_file_lba(const char *filename) { com32sys_t inregs; - uint32_t lba; + uint32_t lba = 0; + int size = 65536; + char *buf; /* Start with clean registers */ memset(&inregs, 0, sizeof(com32sys_t)); + buf = lmalloc(size); + if (!buf) + return 0; + /* Put the filename in the bounce buffer */ - strlcpy(__com32....
2012 Oct 19
4
[LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
...register was consumed but unused A way to do this is to make clang produce byval for anything that goes on the stack, but that produces worse code as the caller now has to use an alloca instead of a simple value. Another option (which I implemented in a patch just sent to llvm-commits) is use the inreg attribute which we already use for the regparm C attribute. The above requirements are handled by putting inreg in the arguments that should go in register and creating a inreg padding argument when a register should be consumed but not used. The above examples would be irgened to: declare x86_fa...
2016 Mar 03
2
RFC: Implementing the Swift calling convention in LLVM and Clang
...9;s ability to not mess up your fiddling with variable > arguments seems unstable. Adding specific attributes to functions or > arguments seem too invasive. I’m not sure why you say that. We already do have parameter ABI override attributes with target-specific behavior in LLVM IR: sret and inreg. I can understand being uneasy with adding new swiftcc-specific attributes, though. It would be reasonable to make this more general. Attributes can be parameterized; maybe we could just say something like abi(“context”), and leave it to the CC to interpret that? Having that sort of ability migh...
2003 Apr 21
3
COM32 Question
Does the COMBOOT stuff with 2.04 work correctly with function calls? or does one need to write it as one huge function? If memory serves me correctly, there was some problem if hello.c was modified to include additional functions, in an earlier version. - Murali
2012 Oct 19
0
[LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
...ee a design for how to specify in the IR which register(s) (if any register(s)) a particular value should be placed into. Don't get me wrong, I don't have any good ideas about how to do this, I'm just hoping someone does. End result might allow something like: declare void @foo(double inreg <eax,edx> %x) On Fri, Oct 19, 2012 at 8:17 AM, Rafael Espíndola < rafael.espindola at gmail.com> wrote: > Functions with __attribute__((fastcall)) pop their arguments and take > up to two arguments in ecx and edx. Currently we represent them by > just setting the x86_fastcal...
2016 Mar 03
2
RFC: Implementing the Swift calling convention in LLVM and Clang
...ate under >> the Swift CC resembles the frontend lowering of the same aggregate under AAPCS. > > Right, ignore me, then. > > >> I’m not sure why you say that. We already do have parameter ABI override >> attributes with target-specific behavior in LLVM IR: sret and inreg. > > Their meaning is somewhat confused and hard-coded in the back-end. I > once wanted to use inreg for lowering register-based divmod in > SelectionDAG, but ended up implementing custom lowering in the ARM > back-end because inreg wasn't used correctly. It's possible that...
2013 Oct 17
1
[PATCH] chain: Fix chainloading on 6.02
...14 insertions(+), 8 deletions(-) diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c index 0b0c737..47ecb52 100644 --- a/com32/lib/syslinux/disk.c +++ b/com32/lib/syslinux/disk.c @@ -171,22 +171,28 @@ out: static void *ebios_setup(const struct disk_info *const diskinfo, com32sys_t *inreg, uint64_t lba, uint8_t count, uint8_t op_code) { - static __lowmem struct disk_ebios_dapa dapa; + static struct disk_ebios_dapa *dapa = NULL; void *buf; + if (!dapa) { + dapa = lmalloc(sizeof *dapa); + if (!dapa) + return NULL; + } + buf = lmalloc(count * diskinfo-&...
2010 Jul 01
2
[PATCH] ifplop.c32: Detect if PLoP USB/CD INT13h hook is enabled/disabled
...http://www.plop.at/en/bootmanager.html + */ + +#include <com32.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <alloca.h> +#include <console.h> +#include <syslinux/boot.h> + +static bool plop_INT13h_check(void) +{ + com32sys_t inregs, outregs; + + /* Prepare the register set */ + memset(&inregs, 0, sizeof inregs); + + /* + * Check if PLoP already has booted a CDROM or USB drive by checking + * for the presence of the PLoP INT13h hook. + * + * The following assembly code (NASM) can detect the PLoP I...
2013 Sep 17
0
[PATCH 1/2] com32/lib/: Avoid unneeded allocation.
...1 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/com32/lib/syslinux/disk.c b/com32/lib/syslinux/disk.c > index 093751a..554bed3 100644 > --- a/com32/lib/syslinux/disk.c > +++ b/com32/lib/syslinux/disk.c > @@ -73,7 +73,7 @@ int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg) > int disk_get_params(int disk, struct disk_info *const diskinfo) > { > static com32sys_t inreg, outreg; > - struct disk_ebios_eparam *eparam; > + struct disk_ebios_eparam *eparam = NULL; > int rv = 0; > > memset(diskinfo, 0, si...