Specifications

254 AMD Geode™ GeodeROM Functional Specification
Configuring/Customizing
32087C
User Functions
The DO_FUNCTION functions are contained in the SETMAIN.C file, and may be modified by the user. The function is a ‘c’
function with a ‘c’ calling sequence. The prototype of the function is:
int function_name(int menu, int item);
Where:
Menu is the ordinal number of the menu that contains the item.
Item is the ordinal number of the item within the menu.
The function must return one of the following:
Zero – The function had an error. An error beep will sound. No GOTO_MENU (if any was defined) will be done.
One – The function was successful. Any GOTO_MENU define will be done.
Negative number – Exit up n levels of menu. A -1 will go up one menu.
Predefined Special User Functions
The following functions are pre-written, contained in the SETMAIN.C file, and may be called with the DO_FUNCTION
macro.
load_current
Loads all fields with the current values from NVRAM for each token defined in a FIELD_DEF macro. Any value stored in a
field is replaced. Unsaved values are lost.
This function always returns a 1.
Function prototype: int load_current(int menu,int item);
load_defaults
Loads all fields with the default values of NVRAM for each token defined in a FIELD_DEF macro. Any value stored in a field
is replaced.
This function always returns a 1.
Function prototype: int load_defaults(int menu,int item);
save_changed_values
Loads all fields with the default values of NVRAM for each token. In addition, NVRAM is checksummed and the failed boot
flag in NVRAM is cleared.
This function always returns a 1.
Function prototype: int save_changed_values(int menu,int item);
exit_no_save
Brings up a question box asking if the user wants to exit without saving. If the user answers “no”, the function exits with a
return code 1, keeping the same menu and item. If the user answers “yes”, the function exits with a -99, forcing setup to ter-
minate. The system will then reboot.
Function prototype: int exit_no_save(int menu,int item);
exit_with_save
Closes out the menu definitions and performs final clean-up as needed.
Function prototype: int exit_with_save(int menu,int item);
get_mem_stuff
Reads the MC_MEM_CTRL1, MC_MEM_CTRL2, and the MC_SYNC_TIM1 registers, splits out the subfields, and sets the
appropriate fields for MANUAL memory optimization.
This function always returns a 1.
Function prototype: int get_mem_stuff(void);