Commit 72d5b7c1 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Employ bit 5 of TaskManager_Shutdown

Harmless on task managers that don't support it.
Uncurled some braces to match local style.
Don't compare "FILE *" with 0, uses NULL.
Switched out unused os_reset_old_machine assembler.

Version 0.45. Tagged as 'InetSetup-0_45'
parent ff01c8fe
/* (0.44)
/* (0.45)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.44
#define Module_MajorVersion_CMHG 0.45
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Jul 2012
#define Module_Date_CMHG 29 Jul 2012
#define Module_MajorVersion "0.44"
#define Module_Version 44
#define Module_MajorVersion "0.45"
#define Module_Version 45
#define Module_MinorVersion ""
#define Module_Date "20 Jul 2012"
#define Module_Date "29 Jul 2012"
#define Module_ApplicationDate "20-Jul-12"
#define Module_ApplicationDate "29-Jul-12"
#define Module_ComponentName "Source"
#define Module_ComponentPath "castle/RiscOS/Sources/SystemRes/InetSetup/Source"
#define Module_FullVersion "0.44"
#define Module_HelpVersion "0.44 (20 Jul 2012)"
#define Module_LibraryVersionInfo "0:44"
#define Module_FullVersion "0.45"
#define Module_HelpVersion "0.45 (29 Jul 2012)"
#define Module_LibraryVersionInfo "0:45"
......@@ -365,7 +365,8 @@ static void FillInterfaceDbox(toolbox_o o, int i)
default: msg = "RevARP"; break;
}
/* RG: I believe the netmask box should be faded for BOOTP/DHCP */
if (interface_addrtype[i] == if_BOOTP || interface_addrtype[i] == if_DHCP) {
if (interface_addrtype[i] == if_BOOTP || interface_addrtype[i] == if_DHCP)
{
gadget_set_flags(0, o, if_Netmask, gadget_FADED);
window_set_default_focus(0, o, (toolbox_c) -2);
}
......
......@@ -436,7 +436,8 @@ void GetInterface(FILE *f, char *s)
else
halfdone = TRUE;
}
else if (strstr(buffer, "DHCPExecute -e -b ")) {
else if (strstr(buffer, "DHCPExecute -e -b "))
{
sscanf(buffer, "DHCPExecute -e -b -w -p %s", unit);
for (i = 0; i < interfaces; i++)
{
......
......@@ -152,7 +152,8 @@ int RMFind(const char *module, const char *filename, int req_version)
if (e)
return 0;
if (xosgbpb_read_at(file, (byte *) &ptr, sizeof(int), 20, 0)) {
if (xosgbpb_read_at(file, (byte *) &ptr, sizeof(int), 20, 0))
{
osfind_close(file);
return 0;
}
......
......@@ -188,15 +188,16 @@ static os_error *SetupInternet(void)
ConfigureFile);
/* RG: Load the DHCP module whether it's the primary interface or not */
for (i=0; i<interfaces; ++i) {
if (interface_addrtype[i] == if_DHCP) {
fprintf(ConfigureFile, "|\n| DHCP pre-interface initialisation\n|\nRMEnsure DHCP %s RMLoad System:Modules.Network.DHCP\n",
VersionToString(v_DHCP));
wanted_dhcp = TRUE;
break;
}
} // end for (i)
for (i=0; i<interfaces; ++i)
{
if (interface_addrtype[i] == if_DHCP)
{
fprintf(ConfigureFile, "|\n| DHCP pre-interface initialisation\n|\nRMEnsure DHCP %s RMLoad System:Modules.Network.DHCP\n",
VersionToString(v_DHCP));
wanted_dhcp = TRUE;
break;
}
}
fprintf(ConfigureFile, "|\n"
"| Host name\n"
......@@ -424,7 +425,6 @@ void SaveSetup(void)
os_error e, *ep;
char buts[64];
int i;
int osversion;
if (!Diagnose())
return;
......@@ -448,7 +448,7 @@ void SaveSetup(void)
0, 0, 0, 0, 0, 0);
ConfigureFile = fopen(CONFIGDIR_WRITE "Startup", "w");
if (ConfigureFile == 0)
if (ConfigureFile == NULL)
{
ep = (os_error *) _kernel_last_oserror();
if (ep)
......@@ -459,7 +459,7 @@ void SaveSetup(void)
}
}
BootFile = fopen("<Boot$ToBeLoaded>.SetUpNet", "w");
if (BootFile == 0)
if (BootFile == NULL)
{
if (InternetEnabled)
fclose(ConfigureFile);
......@@ -540,35 +540,33 @@ void SaveSetup(void)
msgs_lookup("_TaskName")) + 2;
if (i==3)
{
#if 0
wimp_process_key(wimp_KEY_SHIFT|wimp_KEY_CONTROL|wimp_KEY_F12);
int osversion;
/*
* The call to osfscontrol_shutdown was causing disc corruption on
* Raspberry Pi, and shouldn't be needed anyway as we call TaskManager_Shutdown
*/
xhourglass_on();
osfscontrol_shutdown();
xhourglass_off(); /* Not sure why I bother doing this :-) */
osversion = osbyte1(osbyte_IN_KEY, 0, 255);
if (osversion >= 0xA5) /* If we're on RISC OS 3.50 or later... */
os_reset();
else
os_reset_old_machine();
#else
{
/*
* the call to osfscontrol_shutdown was causing disc corruption on
* Raspberry Pi, and shouldn't be needed anyway as we call TaskManager_Shutdown
*/
// xhourglass_on();
// osfscontrol_shutdown();
// xhourglass_off(); /* Not sure why I bother doing this :-) */
// osversion = osbyte1(osbyte_IN_KEY, 0, 255);
// if (osversion >= 0xA5) /* If we're on RISC OS 3.50 or later... */
// os_reset();
// else
// os_reset_old_machine();
/*
* A nicer shutdown - on versions that support it (TaskManager 1.36+)
* bit 5 causes a reboot to occur after shutdown. If an older TM is in use,
* the shutdown screen will be displayed.
* NOTE - Current OS_Reset (which the TaskManager calls if bit 5 is set)
* causes a data abort on Raspberry Pi, so bit 5 can't be used yet.
*/
int flags = /*(1<<5) |*/ (1<<3);
_swix(TaskManager_Shutdown, _IN(0), flags);
}
* the restart prompt will be displayed.
*/
_swix(TaskManager_Shutdown, _IN(0), (1<<5) | (1<<3));
#endif
}
else
exit(0);
exit(0);
}
static void SaveInterface(int i)
......
......@@ -35,6 +35,7 @@ my_actionbutton_set_click_show
SWI Toolbox_ObjectMiscOp
Return "R4,R5"
[ {FALSE}
EXPORT os_reset_old_machine
os_reset_old_machine
MOV R1,#Service_PreReset
......@@ -49,6 +50,8 @@ os_reset_old_machine
LDR R1,[R0,#0]
STR R1,[R0,-R0]
MOV PC,#0
]
;
; Routines to provide OSLib 5.1 functionality when linked with OSLib 4.8
;
......
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