aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-05-12 12:24:12 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-05-12 12:24:12 +0800
commit516183b9ea5424090ea285a3d667d45553d1860e (patch)
tree5ebd04c3573bfb4dbea8b6bc6f115cf109065913
parent1e7425a956fa1681c86aee6044d4dcc46abd9121 (diff)
downloaddevel-516183b9ea5424090ea285a3d667d45553d1860e.tar.gz
devel-516183b9ea5424090ea285a3d667d45553d1860e.tar.xz
devel-516183b9ea5424090ea285a3d667d45553d1860e.zip
Changing on getfssec() to make it more like C
-rwxr-xr-xa.outbin27316 -> 26980 bytes
-rw-r--r--extlinux.c75
2 files changed, 38 insertions, 37 deletions
diff --git a/a.out b/a.out
index da1dda9..d1b97e9 100755
--- a/a.out
+++ b/a.out
Binary files differ
diff --git a/extlinux.c b/extlinux.c
index d2b22bc..d876084 100644
--- a/extlinux.c
+++ b/extlinux.c
@@ -455,47 +455,48 @@ int getfssec(char *buf, struct open_file_t *file, int sectors, int *have_more)
if ( sectors > sector_left )
sectors = sector_left;
- getfragment:
- sector_idx = file->file_sector;
- next_sector = frag_start = linsector(sector_idx, file);
- con_sec_cnt = 0;
-
- getseccnt:
do {
- con_sec_cnt ++;
- sectors --;
- if ( sectors <= 0 )
- break;
+ /* get the frament */
+
+ sector_idx = file->file_sector;
+ next_sector = frag_start = linsector(sector_idx, file);
+ con_sec_cnt = 0;
- /***
- * well, in Syslinux that means in real mode, there's a
- * 64k block limit, so we should need handle it here.
- *
- * But it's a user program that test the driver, so we
- * don't need to do this here but should remember do it
- * when we move into Sylinux.
- */
- sector_idx ++;
- next_sector ++;
- }while( next_sector == linsector(sector_idx, file) );
-
-
- do_read:
- /* Debug message */
-#if 0
- printf("/**********************************************************\n");
- printf(" the file you are reading stores at sector --0x%x--0x%x\n",
- frag_start, frag_start + con_sec_cnt -1);
- printf("**********************************************************/\n");
+ do {
+ /* get the consective sectors count */
+
+ con_sec_cnt ++;
+ sectors --;
+ if ( sectors <= 0 )
+ break;
+
+ /***
+ * well, in Syslinux that means in real mode, there's a
+ * 64k block limit, so we should need handle it here.
+ *
+ * But it's a user program that test the driver, so we
+ * don't need to do this here but should remember do it
+ * when we move into Sylinux.
+ */
+ sector_idx ++;
+ next_sector ++;
+ }while( next_sector == linsector(sector_idx, file) );
+
+
+
+#if 0 /* Debug message */
+ printf("/**********************************************************\n");
+ printf(" the file you are reading stores at sector --0x%x--0x%x\n",
+ frag_start, frag_start + con_sec_cnt -1);
+ printf("**********************************************************/\n");
#endif
+
+ getlinsec_ext(buf, frag_start, con_sec_cnt);
+ buf += con_sec_cnt << 9;
+ file->file_sector += con_sec_cnt; /* next sector index */
+ }while(sectors);
+
- getlinsec_ext(buf, frag_start, con_sec_cnt);
- buf += con_sec_cnt << 9;
- file->file_sector += con_sec_cnt; /* next sector index */
-
- if ( sectors )
- goto getfragment;
- done:
if ( bytes_read >= file->file_bytesleft ) {
bytes_read = file->file_bytesleft;
close_file(file);