summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-16 21:52:02 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-16 21:52:02 (GMT)
commited763539951307353042c04af5c2278db0d05298 (patch)
tree6206d2fe355c6f3fc9526c4d37df5fb1ec55d182 /src/glibext
parent13d12a85fa661c2f331a4ad61ef921d942ce9176 (diff)
Ensured all registered binary portions are fully included in the file.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbinportion.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 731cd08..c0e14fa 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -488,7 +488,7 @@ const mrange_t *g_binary_portion_get_range(const GBinPortion *portion)
/******************************************************************************
* *
* Paramètres : portion = description de partie à mettre à jour. *
-* max = première position physique hors limite. *
+* max = taille maximale accordée à la portion. *
* *
* Description : Assure qu'une portion ne dépasse pas une position donnée. *
* *
@@ -501,19 +501,14 @@ const mrange_t *g_binary_portion_get_range(const GBinPortion *portion)
bool g_binary_portion_limit_range(GBinPortion *portion, phys_t max)
{
bool result; /* Bilan à retourner */
- vmpa2t end; /* Limite actuelle de portion */
- const vmpa2t *start; /* Position de départ */
+ phys_t current; /* Taille courante */
- compute_mrange_end_addr(&portion->range, &end);
+ current = get_mrange_length(&portion->range);
- result = get_phy_addr(&end) > max;
+ result = (current > max);
if (result)
- {
- start = get_mrange_addr(&portion->range);
- set_mrange_length(&portion->range, max - get_phy_addr(start));
-
- }
+ set_mrange_length(&portion->range, max);
return result;