int bsp_post_init_kenv struct l_vars lvar_ptr amount of address space

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
int
bsp_post_init_kenv(struct l_vars *lvar_ptr)
{
/* amount of address space reserved for permap */
uint32_t permap_size;
uint32_t reboot_flags; /* reboot flags (LEGACY!) */
uint32_t root_dev; /* major number of root device */
/* Pointer to pre-MMU CSP global variables */
struct l_csp *l_csp = (struct l_csp *) lvar_ptr->l_csp;
int error = OK;
/*
** Get all interesting environmental info out of FIRMWARE
*/
error = get_firmware_env_post(lvar_ptr);
if (error == SYSERR)
{
debug(("get_firmware_env_post failed\n"));
CRASH();
}
/* Set the supported kernel segment size */
set_kenv_variable(K_ENV_KSEG_SIZE, &l_csp->kseg_size);
/*
** Compute and then set the permap space size available after IOBASE mapping:
** Subtract total amount of address space used for I/O from kernel segment
** size.
*/
permap_size = ML510_PERLIMIT_SIZE;
perlimit = ML510_PERLIMIT;
#if defined (CODETEST)
permap_size -= PAGESIZE;
#endif /* CODETEST */
set_kenv_variable(K_ENV_PERMAP_SIZE, &permap_size);
/*set bottom limit of the permap area PR-8427*/
perlimit_end = perlimit - permap_size;
debug(("permap_size 0x%x perlimit_end 0x%x kseg_size 0x%x\n",
permap_size,perlimit_end,l_csp->kseg_size));
/*
** In case of a KDI, retrieve root-filesystem device number and
** bootflags and stuff them into the kernel environment.