# Why is MAX\_NUM\_FREEMEM\_REG defined in two different places?

**URL:** <https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330>\
**Category:** seL4 kernel\
**Created:** [March 30, 2021, 4:25am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330 "2021-03-30T04:25:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bennoleslie](https://yyz2.discourse-cdn.com/free1/user_avatar/sel4.discourse.group/bennoleslie/32/80_2.png) [@bennoleslie](https://sel4.discourse.group/u/bennoleslie)\
**Post date:** [March 30, 2021, 4:25am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330/1 "2021-03-30T04:25:38Z")

</div>

It seems like `MAX_NUM_FREEMEM_REG` is defined in `bootinfo.h and `boot.h`(which includes`bootinfo.h`.

Is there a reason for having it define din both places? It is somewhat inconvenient when you need to change it.

Thanks!

---

<div class="post-metadata">

**Author:** ![anna.lyons](https://yyz2.discourse-cdn.com/free1/user_avatar/sel4.discourse.group/anna.lyons/32/4_2.png) [@anna.lyons](https://sel4.discourse.group/u/anna.lyons)\
**Post date:** [March 30, 2021, 4:54am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330/2 "2021-03-30T04:54:21Z")

</div>

I can’t see any reason. Probably copy + paste error from the last boot refactor we did. Clean away :).

---

<div class="post-metadata">

**Author:** ![kent-mcleod2](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kent-mcleod2](https://sel4.discourse.group/u/kent-mcleod2)\
**Post date:** [March 30, 2021, 5:13am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330/3 "2021-03-30T05:13:43Z")

</div>

I think the intention was for the common definition in kernel/boot.h to have been removed.

> <https://github.com/seL4/seL4/commit/b5c56244f1394940fbb871616e6a80041fa1b038>

---

<div class="post-metadata">

**Author:** ![bennoleslie](https://yyz2.discourse-cdn.com/free1/user_avatar/sel4.discourse.group/bennoleslie/32/80_2.png) [@bennoleslie](https://sel4.discourse.group/u/bennoleslie)\
**Post date:** [March 30, 2021, 5:22am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330/4 "2021-03-30T05:22:32Z")

</div>

You’re like a mind reader… was about to ask which one should go 🙂

---

<div class="post-metadata">

**Author:** ![kent-mcleod2](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kent-mcleod2](https://sel4.discourse.group/u/kent-mcleod2)\
**Post date:** [July 11, 2021, 12:21am UTC](https://sel4.discourse.group/t/why-is-max-num-freemem-reg-defined-in-two-different-places/330/5 "2021-07-11T00:21:05Z")

</div>

> <https://github.com/seL4/seL4/pull/450>
>
> These defines seem redundant, they exist the architecture specific \`bootinho.h\` …already and this seems the better place due to the subtle differences
