Browse Source

m68k-atari: mark functions and API calls related to exiting the program as noreturn

Karoly Balogh 1 year ago
parent
commit
572a340a26

+ 3 - 3
packages/tosunits/src/gemdos.pas

@@ -194,7 +194,7 @@ type
   end;
   end;
 
 
 
 
-procedure gemdos_pterm0; syscall 1 0;
+procedure gemdos_pterm0; noreturn; syscall 1 0;
 function gemdos_cconin: longint; syscall 1 1;
 function gemdos_cconin: longint; syscall 1 1;
 function gemdos_cconout(c: smallint): longint; syscall 1 2;
 function gemdos_cconout(c: smallint): longint; syscall 1 2;
 function gemdos_cauxin: longint; syscall 1 3;
 function gemdos_cauxin: longint; syscall 1 3;
@@ -228,7 +228,7 @@ function gemdos_tsettime(time: word): word; syscall 1 45;
 
 
 function gemdos_fgetdta: PDTA; syscall 1 47;
 function gemdos_fgetdta: PDTA; syscall 1 47;
 function gemdos_sversion: smallint; syscall 1 48;
 function gemdos_sversion: smallint; syscall 1 48;
-procedure gemdos_ptermres(keepcnt: longint; returncode: smallint); syscall 1 49;
+procedure gemdos_ptermres(keepcnt: longint; returncode: smallint); noreturn; syscall 1 49;
 function gemdos_sconfig(mode: smallint; flags: longint): longint; syscall 1 51;
 function gemdos_sconfig(mode: smallint; flags: longint): longint; syscall 1 51;
 
 
 function gemdos_dfree(var buf: TDISKINFO; driveno: smallint): smallint; syscall 1 54;
 function gemdos_dfree(var buf: TDISKINFO; driveno: smallint): smallint; syscall 1 54;
@@ -252,7 +252,7 @@ function gemdos_malloc(number: dword): pointer; syscall 1 72;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function gemdos_pexec(mode: word; name: PAnsiChar; cmdline: PAnsiChar; env: PAnsiChar): longint; syscall 1 75;
 function gemdos_pexec(mode: word; name: PAnsiChar; cmdline: PAnsiChar; env: PAnsiChar): longint; syscall 1 75;
-procedure gemdos_pterm(returncode: smallint); syscall 1 76;
+procedure gemdos_pterm(returncode: smallint); noreturn; syscall 1 76;
 
 
 function gemdos_fsfirst(const filename: PAnsiChar; attr: smallint): longint; syscall 1 78;
 function gemdos_fsfirst(const filename: PAnsiChar; attr: smallint): longint; syscall 1 78;
 function gemdos_fsnext: smallint; syscall 1 79;
 function gemdos_fsnext: smallint; syscall 1 79;

+ 3 - 3
packages/tosunits/src/tos.pas

@@ -249,7 +249,7 @@ function Metaioctl(drive: smallint; magic: LongInt; opcode: smallint; buffer: Po
 (*                  GEMDOS                  *)
 (*                  GEMDOS                  *)
 (* ++++++++++++++++++++++++++++++++++++++++ *)
 (* ++++++++++++++++++++++++++++++++++++++++ *)
 
 
-procedure pterm0; syscall 1 0;
+procedure pterm0; noreturn; syscall 1 0;
 function cconin: longint; syscall 1 1;
 function cconin: longint; syscall 1 1;
 function cconout(c: smallint): longint; syscall 1 2;
 function cconout(c: smallint): longint; syscall 1 2;
 function cauxin: longint; syscall 1 3;
 function cauxin: longint; syscall 1 3;
@@ -283,7 +283,7 @@ function tsettime(time: word): word; syscall 1 45;
 
 
 function fgetdta: DTAPtr; syscall 1 47;
 function fgetdta: DTAPtr; syscall 1 47;
 function sversion: smallint; syscall 1 48;
 function sversion: smallint; syscall 1 48;
-procedure ptermres(keepcnt: longint; returncode: smallint); syscall 1 49;
+procedure ptermres(keepcnt: longint; returncode: smallint); noreturn; syscall 1 49;
 function sconfig(mode: smallint; flags: longint): longint; syscall 1 51;
 function sconfig(mode: smallint; flags: longint): longint; syscall 1 51;
 
 
 function dfree(out buf: TDISKINFO; driveno: smallint): smallint; syscall 1 54;
 function dfree(out buf: TDISKINFO; driveno: smallint): smallint; syscall 1 54;
@@ -308,7 +308,7 @@ function free(block: pointer): dword; syscall 1 73;
 function mfree(block: pointer): dword; syscall 1 73;
 function mfree(block: pointer): dword; syscall 1 73;
 function mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function pexec(mode: word; const name: shortstring; cmdline: shortstring; env: PAnsiChar): longint;
 function pexec(mode: word; const name: shortstring; cmdline: shortstring; env: PAnsiChar): longint;
-procedure pterm(returncode: smallint); syscall 1 76;
+procedure pterm(returncode: smallint); noreturn; syscall 1 76;
 
 
 function fsfirst(const filename: shortstring; attr: smallint): longint;
 function fsfirst(const filename: shortstring; attr: smallint): longint;
 function fsnext: smallint;
 function fsnext: smallint;

+ 1 - 1
rtl/atari/gemdos.inc

@@ -157,7 +157,7 @@ function gemdos_malloc(number: dword): pointer; syscall 1 72;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mfree(block: pointer): dword; syscall 1 73;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function gemdos_mshrink(zero: word; block: pointer; newsiz: longint): longint; syscall 1 74;
 function gemdos_pexec(mode: word; name: PAnsiChar; cmdline: PAnsiChar; env: PAnsiChar): longint; syscall 1 75;
 function gemdos_pexec(mode: word; name: PAnsiChar; cmdline: PAnsiChar; env: PAnsiChar): longint; syscall 1 75;
-procedure gemdos_pterm(returncode: smallint); syscall 1 76;
+procedure gemdos_pterm(returncode: smallint); noreturn; syscall 1 76;
 
 
 function gemdos_fsfirst(filename: PAnsiChar; attr: smallint): longint; syscall 1 78;
 function gemdos_fsfirst(filename: PAnsiChar; attr: smallint): longint; syscall 1 78;
 function gemdos_fsnext: smallint; syscall 1 79;
 function gemdos_fsnext: smallint; syscall 1 79;

+ 1 - 1
rtl/atari/si_prc.pp

@@ -69,7 +69,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-procedure _FPC_proc_halt(_ExitCode: longint); cdecl; public name '_haltproc';
+procedure _FPC_proc_halt(_ExitCode: longint); cdecl; public name '_haltproc'; noreturn;
 begin
 begin
   gemdos_pterm(_ExitCode);
   gemdos_pterm(_ExitCode);
 end;
 end;

+ 3 - 2
rtl/atari/system.pp

@@ -21,6 +21,7 @@ interface
 {$define FPC_IS_SYSTEM}
 {$define FPC_IS_SYSTEM}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_STDOUT_TRUE_ALIAS}
 {$define FPC_ANSI_TEXTFILEREC}
 {$define FPC_ANSI_TEXTFILEREC}
+{$define FPC_SYSTEM_EXIT_NO_RETURN}
 {$define FPC_SYSTEM_NO_VERBOSE_UNICODEERROR}
 {$define FPC_SYSTEM_NO_VERBOSE_UNICODEERROR}
 
 
 {.$define FPC_ATARI_USE_TINYHEAP}
 {.$define FPC_ATARI_USE_TINYHEAP}
@@ -159,9 +160,9 @@ end;
 {*****************************************************************************
 {*****************************************************************************
                          System Dependent Exit code
                          System Dependent Exit code
 *****************************************************************************}
 *****************************************************************************}
-procedure haltproc(e:longint); cdecl; external name 'haltproc';
+procedure haltproc(e:longint); cdecl; external name 'haltproc'; noreturn;
 
 
-Procedure system_exit;
+Procedure system_exit; noreturn;
 begin
 begin
   haltproc(ExitCode);
   haltproc(ExitCode);
 end;
 end;