[coreboot] [PATCH] resource allocator hole handling (simple and old)

Stefan Reinauer stepan at coresystems.de
Wed Oct 28 15:35:34 CET 2009


Myles Watson wrote:
> Index: src/devices/device.c
> ===================================================================
> --- src/devices/device.c	(revision 4842)
> +++ src/devices/device.c	(working copy)
> @@ -576,7 +576,7 @@
>  			continue;
>  
>  		/* Is it already outside the limits? */
> -		if (res->size && (((res->base + res->size -1) < lim->base)
> ||
> +		if (!res->size || (((res->base + res->size -1) < lim->base)
> ||
>  				  (res->base > lim->limit)))
>  			continue;
>
> I think fixed resources of size 0 are broken.  I'd rather fix the targets.
> It's hard for the allocator to avoid size 0 resources.
>   

Ok, this seems to be a left-over which came in through intelligent merging.

I checked the code and size 0 resources are skipped already..

                if (!res->size) {
                        /* It makes no sense to have 0-sized, fixed
resources.*/
                        printk_err("skipping %s@%lx fixed resource,
size=0!\n",
                                   dev_path(dev), res->index);
                        continue;
                }

so generally that check for res->size could be dropped completely in
above construct, making it

         /* Is it already outside the limits? */
-        if (res->size && (((res->base + res->size -1) < lim->base) ||
-                  (res->base > lim->limit)))
+        if (((res->base + res->size -1) < lim->base) || (res->base >
lim->limit))
             continue;


Stefan

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866





More information about the coreboot mailing list