summaryrefslogtreecommitdiff
path: root/memdisk
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-29 15:10:33 -0700
commitebda41df24e56adf9da6f7e50412828e097a9ea7 (patch)
tree76fed046bd983095d5cb252fedc68961341f944c /memdisk
parente44ccd5d96d04a917d36a9c9e031f77d3fd0a3e2 (diff)
downloadsyslinux-ebda41df24e56adf9da6f7e50412828e097a9ea7.tar.gz
Run Nindent on memdisk/e820func.c
Automatically reformat memdisk/e820func.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 'memdisk')
-rw-r--r--memdisk/e820func.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/memdisk/e820func.c b/memdisk/e820func.c
index 80471a9b..13c0a6fe 100644
--- a/memdisk/e820func.c
+++ b/memdisk/e820func.c
@@ -29,79 +29,79 @@
struct e820range ranges[MAXRANGES];
int nranges;
-
void e820map_init(void)
{
- memset(ranges, 0, sizeof(ranges));
- nranges = 1;
- ranges[1].type = -1U;
+ memset(ranges, 0, sizeof(ranges));
+ nranges = 1;
+ ranges[1].type = -1U;
}
static void insertrange_at(int where, uint64_t start, uint32_t type)
{
- int i;
+ int i;
- for ( i = nranges ; i > where ; i-- )
- ranges[i] = ranges[i-1];
+ for (i = nranges; i > where; i--)
+ ranges[i] = ranges[i - 1];
- ranges[where].start = start;
- ranges[where].type = type;
+ ranges[where].start = start;
+ ranges[where].type = type;
- nranges++;
- ranges[nranges].start = 0ULL;
- ranges[nranges].type = -1U;
+ nranges++;
+ ranges[nranges].start = 0ULL;
+ ranges[nranges].type = -1U;
}
void insertrange(uint64_t start, uint64_t len, uint32_t type)
{
- uint64_t last;
- uint32_t oldtype;
- int i, j;
-
- /* Remove this to make len == 0 mean all of memory */
- if ( len == 0 )
- return; /* Nothing to insert */
-
- last = start+len-1; /* May roll over */
-
- i = 0;
- oldtype = -2U;
- while ( start > ranges[i].start && ranges[i].type != -1U ) {
- oldtype = ranges[i].type;
- i++;
- }
-
- /* Consider the replacement policy. This current one is "overwrite." */
-
- if ( start < ranges[i].start || ranges[i].type == -1U )
- insertrange_at(i++, start, type);
-
- while ( i == 0 || last > ranges[i].start-1 ) {
- oldtype = ranges[i].type;
- ranges[i].type = type;
- i++;
- }
-
- if ( last < ranges[i].start-1 )
- insertrange_at(i, last+1, oldtype);
-
- /* Now the map is correct, but quite possibly not optimal. Scan the
- map for ranges which are redundant and remove them. */
- i = j = 1;
- oldtype = ranges[0].type;
- while ( i < nranges ) {
- if ( ranges[i].type == oldtype ) {
- i++;
- } else {
- oldtype = ranges[i].type;
- if ( i != j )
- ranges[j] = ranges[i];
- i++; j++;
+ uint64_t last;
+ uint32_t oldtype;
+ int i, j;
+
+ /* Remove this to make len == 0 mean all of memory */
+ if (len == 0)
+ return; /* Nothing to insert */
+
+ last = start + len - 1; /* May roll over */
+
+ i = 0;
+ oldtype = -2U;
+ while (start > ranges[i].start && ranges[i].type != -1U) {
+ oldtype = ranges[i].type;
+ i++;
}
- }
- if ( i != j ) {
- ranges[j] = ranges[i]; /* Termination sentinel copy */
- nranges -= (i-j);
- }
+ /* Consider the replacement policy. This current one is "overwrite." */
+
+ if (start < ranges[i].start || ranges[i].type == -1U)
+ insertrange_at(i++, start, type);
+
+ while (i == 0 || last > ranges[i].start - 1) {
+ oldtype = ranges[i].type;
+ ranges[i].type = type;
+ i++;
+ }
+
+ if (last < ranges[i].start - 1)
+ insertrange_at(i, last + 1, oldtype);
+
+ /* Now the map is correct, but quite possibly not optimal. Scan the
+ map for ranges which are redundant and remove them. */
+ i = j = 1;
+ oldtype = ranges[0].type;
+ while (i < nranges) {
+ if (ranges[i].type == oldtype) {
+ i++;
+ } else {
+ oldtype = ranges[i].type;
+ if (i != j)
+ ranges[j] = ranges[i];
+ i++;
+ j++;
+ }
+ }
+
+ if (i != j) {
+ ranges[j] = ranges[i]; /* Termination sentinel copy */
+ nranges -= (i - j);
+ }
}