aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:20 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:20 -0700
commit88a901de6c90307298ae2c9548eb0244e10586eb (patch)
tree77d82e100103b401121510c2becfaf781220a8a5 /com32/cmenu
parentef11da7691ba91699f1ab707735c617614cd274f (diff)
downloadsyslinux-88a901de6c90307298ae2c9548eb0244e10586eb.tar.gz
syslinux-88a901de6c90307298ae2c9548eb0244e10586eb.tar.xz
syslinux-88a901de6c90307298ae2c9548eb0244e10586eb.zip
Run Nindent on com32/cmenu/libmenu/syslnx.c
Automatically reformat com32/cmenu/libmenu/syslnx.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/cmenu')
-rw-r--r--com32/cmenu/libmenu/syslnx.c101
1 files changed, 53 insertions, 48 deletions
diff --git a/com32/cmenu/libmenu/syslnx.c b/com32/cmenu/libmenu/syslnx.c
index d2b0aef4..5cc19333 100644
--- a/com32/cmenu/libmenu/syslnx.c
+++ b/com32/cmenu/libmenu/syslnx.c
@@ -14,75 +14,80 @@
#include <com32.h>
#include "syslnx.h"
-com32sys_t inreg,outreg; // Global registers for this module
+com32sys_t inreg, outreg; // Global registers for this module
char issyslinux(void)
{
- REG_EAX(inreg) = 0x00003000;
- REG_EBX(inreg) = REG_ECX(inreg) = REG_EDX(inreg) = 0xFFFFFFFF;
- __intcall(0x21,&inreg,&outreg);
- return (REG_EAX(outreg) == 0x59530000) &&
- (REG_EBX(outreg) == 0x4c530000) &&
- (REG_ECX(outreg) == 0x4e490000) &&
- (REG_EDX(outreg) == 0x58550000);
+ REG_EAX(inreg) = 0x00003000;
+ REG_EBX(inreg) = REG_ECX(inreg) = REG_EDX(inreg) = 0xFFFFFFFF;
+ __intcall(0x21, &inreg, &outreg);
+ return (REG_EAX(outreg) == 0x59530000) &&
+ (REG_EBX(outreg) == 0x4c530000) &&
+ (REG_ECX(outreg) == 0x4e490000) && (REG_EDX(outreg) == 0x58550000);
}
void runsyslinuxcmd(const char *cmd)
{
- strcpy(__com32.cs_bounce, cmd);
- REG_AX(inreg) = 0x0003; // Run command
- REG_BX(inreg) = OFFS(__com32.cs_bounce);
- REG_ES(inreg) = SEG(__com32.cs_bounce);
- __intcall(0x22, &inreg, &outreg);
+ strcpy(__com32.cs_bounce, cmd);
+ REG_AX(inreg) = 0x0003; // Run command
+ REG_BX(inreg) = OFFS(__com32.cs_bounce);
+ REG_ES(inreg) = SEG(__com32.cs_bounce);
+ __intcall(0x22, &inreg, &outreg);
}
void gototxtmode(void)
{
- REG_AX(inreg) = 0x0005;
- __intcall(0x22,&inreg,&outreg);
+ REG_AX(inreg) = 0x0005;
+ __intcall(0x22, &inreg, &outreg);
}
void syslinux_idle(void)
{
- REG_AX(inreg) = 0x0013;
- __intcall(0x22,&inreg,&outreg);
+ REG_AX(inreg) = 0x0013;
+ __intcall(0x22, &inreg, &outreg);
}
-unsigned int getversion(char *deriv,unsigned int *numfun)
+unsigned int getversion(char *deriv, unsigned int *numfun)
{
- REG_AX(inreg) = 0x0001;
- __intcall(0x22,&inreg,&outreg);
- if (deriv) *deriv= REG_DL(outreg);
- if (numfun) *numfun = REG_AX(outreg);
- return REG_CX(outreg);
+ REG_AX(inreg) = 0x0001;
+ __intcall(0x22, &inreg, &outreg);
+ if (deriv)
+ *deriv = REG_DL(outreg);
+ if (numfun)
+ *numfun = REG_AX(outreg);
+ return REG_CX(outreg);
}
-void runsyslinuximage(const char*cmd, long ipappend)
+void runsyslinuximage(const char *cmd, long ipappend)
{
- unsigned int numfun = 0;
- char *ptr,*cmdline;
+ unsigned int numfun = 0;
+ char *ptr, *cmdline;
- getversion(NULL,&numfun);
- // Function 16h not supported Fall back to runcommand
- if (numfun < 0x16) runsyslinuxcmd(cmd);
- // Try the Run Kernel Image function
- // Split command line into
- strcpy(__com32.cs_bounce,cmd);
- ptr = __com32.cs_bounce;
- // serach for first space or end of string
- while ( (*ptr) && (*ptr != ' ')) ptr++;
- if (!*ptr) cmdline = ptr; // no command line
- else {
- *ptr++='\0'; // terminate kernal name
- cmdline = ptr+1;
- while (*cmdline != ' ') cmdline++; // find first non-space
- }
- // Now call the interrupt
- REG_BX(inreg) = OFFS(cmdline);
- REG_ES(inreg) = SEG(cmdline);
- REG_SI(inreg) = OFFS(__com32.cs_bounce);
- REG_DS(inreg) = SEG(__com32.cs_bounce);
- REG_EDX(inreg) = 0;
+ getversion(NULL, &numfun);
+ // Function 16h not supported Fall back to runcommand
+ if (numfun < 0x16)
+ runsyslinuxcmd(cmd);
+ // Try the Run Kernel Image function
+ // Split command line into
+ strcpy(__com32.cs_bounce, cmd);
+ ptr = __com32.cs_bounce;
+ // serach for first space or end of string
+ while ((*ptr) && (*ptr != ' '))
+ ptr++;
+ if (!*ptr)
+ cmdline = ptr; // no command line
+ else {
+ *ptr++ = '\0'; // terminate kernal name
+ cmdline = ptr + 1;
+ while (*cmdline != ' ')
+ cmdline++; // find first non-space
+ }
+ // Now call the interrupt
+ REG_BX(inreg) = OFFS(cmdline);
+ REG_ES(inreg) = SEG(cmdline);
+ REG_SI(inreg) = OFFS(__com32.cs_bounce);
+ REG_DS(inreg) = SEG(__com32.cs_bounce);
+ REG_EDX(inreg) = 0;
- __intcall(0x22,&inreg,&outreg); // If successful does not return
+ __intcall(0x22, &inreg, &outreg); // If successful does not return
}