aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:30 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:30 -0700
commitd037cca3d71683703648a7ae27cbb64fc4e6e65c (patch)
tree688e3de68318284975d1d357fd010bfde04f5e9b /com32
parent0edc23c55ee69328be9d859aec3fee24858bbdcf (diff)
downloadsyslinux.git-d037cca3d71683703648a7ae27cbb64fc4e6e65c.tar.gz
syslinux.git-d037cca3d71683703648a7ae27cbb64fc4e6e65c.tar.xz
syslinux.git-d037cca3d71683703648a7ae27cbb64fc4e6e65c.zip
Run Nindent on com32/modules/sanboot.c
Automatically reformat com32/modules/sanboot.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/modules/sanboot.c142
1 files changed, 71 insertions, 71 deletions
diff --git a/com32/modules/sanboot.c b/com32/modules/sanboot.c
index b8bfe25e..eee9f44c 100644
--- a/com32/modules/sanboot.c
+++ b/com32/modules/sanboot.c
@@ -26,115 +26,115 @@
#include <syslinux/config.h>
struct segoff16 {
- uint16_t offs, seg;
+ uint16_t offs, seg;
};
struct s_PXENV_FILE_CHECK_API {
- uint16_t Status;
- uint16_t Size;
- uint32_t Magic;
- uint32_t Provider;
- uint32_t APIMask;
- uint32_t Flags;
+ uint16_t Status;
+ uint16_t Size;
+ uint32_t Magic;
+ uint32_t Provider;
+ uint32_t APIMask;
+ uint32_t Flags;
};
static bool is_gpxe(void)
{
- const struct syslinux_version *sv;
- com32sys_t reg;
- struct s_PXENV_FILE_CHECK_API *fca;
+ const struct syslinux_version *sv;
+ com32sys_t reg;
+ struct s_PXENV_FILE_CHECK_API *fca;
- sv = syslinux_version();
- if (sv->filesystem != SYSLINUX_FS_PXELINUX)
- return false; /* Not PXELINUX */
+ sv = syslinux_version();
+ if (sv->filesystem != SYSLINUX_FS_PXELINUX)
+ return false; /* Not PXELINUX */
- fca = __com32.cs_bounce;
- memset(fca, 0, sizeof *fca);
- fca->Size = sizeof *fca;
- fca->Magic = 0x91d447b2;
+ fca = __com32.cs_bounce;
+ memset(fca, 0, sizeof *fca);
+ fca->Size = sizeof *fca;
+ fca->Magic = 0x91d447b2;
- memset(&reg, 0, sizeof reg);
- reg.eax.w[0] = 0x0009;
- reg.ebx.w[0] = 0x00e6; /* PXENV_FILE_API_CHECK */
- reg.edi.w[0] = OFFS(fca);
- reg.es = SEG(fca);
+ memset(&reg, 0, sizeof reg);
+ reg.eax.w[0] = 0x0009;
+ reg.ebx.w[0] = 0x00e6; /* PXENV_FILE_API_CHECK */
+ reg.edi.w[0] = OFFS(fca);
+ reg.es = SEG(fca);
- __intcall(0x22, &reg, &reg);
+ __intcall(0x22, &reg, &reg);
- if (reg.eflags.l & EFLAGS_CF)
- return false; /* Cannot invoke PXE stack */
+ if (reg.eflags.l & EFLAGS_CF)
+ return false; /* Cannot invoke PXE stack */
- if (reg.eax.w[0] || fca->Status)
- return false; /* PXE failure */
+ if (reg.eax.w[0] || fca->Status)
+ return false; /* PXE failure */
- if (fca->Magic != 0xe9c17b20)
- return false; /* Incorrect magic */
+ if (fca->Magic != 0xe9c17b20)
+ return false; /* Incorrect magic */
- if (fca->Size < sizeof *fca)
- return false; /* Short return */
+ if (fca->Size < sizeof *fca)
+ return false; /* Short return */
- if (!(fca->APIMask & (1 << 5)))
- return false; /* No FILE EXEC */
+ if (!(fca->APIMask & (1 << 5)))
+ return false; /* No FILE EXEC */
- return true;
+ return true;
}
struct s_PXENV_FILE_EXEC {
- uint16_t Status;
- struct segoff16 Command;
+ uint16_t Status;
+ struct segoff16 Command;
};
static void sanboot(const char **args)
{
- char *q;
- struct s_PXENV_FILE_EXEC *fx;
- com32sys_t reg;
+ char *q;
+ struct s_PXENV_FILE_EXEC *fx;
+ com32sys_t reg;
- memset(&reg, 0, sizeof reg);
+ memset(&reg, 0, sizeof reg);
- fx = __com32.cs_bounce;
- q = (char *)(fx+1);
+ fx = __com32.cs_bounce;
+ q = (char *)(fx + 1);
- fx->Status = 1;
- fx->Command.offs = OFFS(q);
- fx->Command.seg = SEG(q);
+ fx->Status = 1;
+ fx->Command.offs = OFFS(q);
+ fx->Command.seg = SEG(q);
- q = stpcpy(q, "sanboot");
+ q = stpcpy(q, "sanboot");
- while (*args) {
- *q++ = ' ';
- q = stpcpy(q, *args);
- args++;
- }
+ while (*args) {
+ *q++ = ' ';
+ q = stpcpy(q, *args);
+ args++;
+ }
- memset(&reg, 0, sizeof reg);
- reg.eax.w[0] = 0x0009;
- reg.ebx.w[0] = 0x00e5; /* PXENV_FILE_EXEC */
- reg.edi.w[0] = OFFS(fx);
- reg.es = SEG(fx);
+ memset(&reg, 0, sizeof reg);
+ reg.eax.w[0] = 0x0009;
+ reg.ebx.w[0] = 0x00e5; /* PXENV_FILE_EXEC */
+ reg.edi.w[0] = OFFS(fx);
+ reg.es = SEG(fx);
- __intcall(0x22, &reg, &reg);
+ __intcall(0x22, &reg, &reg);
- /* This should not return... */
+ /* This should not return... */
}
int main(int argc, const char *argv[])
{
- openconsole(&dev_null_r, &dev_stdcon_w);
+ openconsole(&dev_null_r, &dev_stdcon_w);
- if (argc < 2) {
- printf("Usage: sanboot rootpath\n");
- return 1;
- }
+ if (argc < 2) {
+ printf("Usage: sanboot rootpath\n");
+ return 1;
+ }
- if (!is_gpxe()) {
- printf("sanboot: gPXE API not detected\n");
- return 1;
- }
+ if (!is_gpxe()) {
+ printf("sanboot: gPXE API not detected\n");
+ return 1;
+ }
- sanboot(argv+1);
+ sanboot(argv + 1);
- /* sanboot() should not return... */
- printf("SAN boot failed.\n");
- return 1;
+ /* sanboot() should not return... */
+ printf("SAN boot failed.\n");
+ return 1;
}