Commit ac52c76d authored by Greg Ungerer's avatar Greg Ungerer Committed by David Woodhouse

[PATCH] cleanup is_in_rom() checker

Clean up the dodgy is_in_rom() code for m68knommu targets.

Now that all the m68knommu sub-architectures (68x328, 68360
and ColdFire) have the same memory setup support we can
make this code the same for all targets.
parent a9ae5888
......@@ -114,51 +114,18 @@ unsigned long kernel_map(unsigned long paddr, unsigned long size,
int is_in_rom(unsigned long addr)
{
#ifdef CONFIG_COLDFIRE
{
extern unsigned long _ramstart, _ramend;
/* Anything not in operational RAM is returned as in rom! */
if (addr < _ramstart || addr >= _ramend)
return(1);
}
#endif
#if defined(CONFIG_PILOT) || defined(CONFIG_UCSIMM)
if (addr >= 0x10c00000)
return 1;
#endif
#ifdef CONFIG_M68EZ328ADS
if ( 0x00200000 <= addr && addr < 0x00400000)
return 1;
#endif
#ifdef CONFIG_M68332
extern char _etext;
#ifdef SHGLCORE_ROM_BANK_0_ADDR
if ((addr >= SHGLCORE_ROM_BANK_0_ADDR) &&
(addr < (SHGLCORE_ROM_BANK_0_ADDR+SHGLCORE_ROM_BANK_0_LENGTH)))
return 1;
#endif
#ifdef SHGLCORE_ROM_BANK_1_ADDR
else if ((addr >= SHGLCORE_ROM_BANK_1_ADDR) &&
(addr < (SHGLCORE_ROM_BANK_1_ADDR+SHGLCORE_ROM_BANK_1_LENGTH)))
return 1;
#endif
#ifdef SHGLCORE_FLASH_BANK_0_ADDR
else if ((addr >= SHGLCORE_FLASH_BANK_0_ADDR) &&
(addr < (SHGLCORE_FLASH_BANK_0_ADDR+SHGLCORE_FLASH_BANK_0_LENGTH)))
return 1;
#endif
#ifdef SHGLCORE_FLASH_BANK_1_ADDR
else if ((addr >= SHGLCORE_FLASH_BANK_1_ADDR) &&
(addr < (SHGLCORE_FLASH_BANK_1_ADDR+SHGLCORE_FLASH_BANK_1_LENGTH)))
return 1;
#endif
#endif
extern unsigned long _ramstart, _ramend;
/*
* What we are really trying to do is determine if addr is
* in an allocated kernel memory region. If not then assume
* we cannot free it or otherwise de-allocate it. Ideally
* we could restrict this to really being in a ROM or flash,
* but that would need to be done on a board by board basis,
* not globally.
*/
if ((addr < _ramstart) || (addr >= _ramend))
return(1);
/* Default case, not in ROM */
return(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment