~ubuntu-branches/ubuntu/vivid/basilisk2/vivid

« back to all changes in this revision

Viewing changes to src/Unix/sigsegv.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-03-06 19:33:01 UTC
  • mfrom: (2.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080306193301-cc2ofn705nfsq3y0
Tags: 0.9.20070407-4
* Update copyright-check cdbs snippet to parse licensecheck using perl:
  + No longer randomly drops newlines
  + More compact hint file (and ordered more like wiki-proposed new copyright
    syntax).
  + No longer ignore files without copyright.
* Update copyright_hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Derived from Bruno Haible's work on his SIGSEGV library for clisp
5
5
 *  <http://clisp.sourceforge.net/>
6
6
 *
7
 
 *  Basilisk II (C) 1997-2002 Christian Bauer
 
7
 *  Basilisk II (C) 1997-2005 Christian Bauer
8
8
 *
9
9
 *  This program is free software; you can redistribute it and/or modify
10
10
 *  it under the terms of the GNU General Public License as published by
27
27
// Address type
28
28
typedef char * sigsegv_address_t;
29
29
 
30
 
// Transfer type (intended to be used a mask for sigsegv_*_ignore_range())
31
 
enum sigsegv_transfer_type_t {
32
 
        SIGSEGV_TRANSFER_UNKNOWN        = 0,
33
 
        SIGSEGV_TRANSFER_LOAD           = 1,
34
 
        SIGSEGV_TRANSFER_STORE          = 2,
 
30
// SIGSEGV handler return state
 
31
enum sigsegv_return_t {
 
32
  SIGSEGV_RETURN_SUCCESS,
 
33
  SIGSEGV_RETURN_FAILURE,
 
34
  SIGSEGV_RETURN_SKIP_INSTRUCTION,
35
35
};
36
36
 
37
37
// Type of a SIGSEGV handler. Returns boolean expressing successful operation
38
 
typedef bool (*sigsegv_fault_handler_t)(sigsegv_address_t fault_address, sigsegv_address_t instruction_address);
 
38
typedef sigsegv_return_t (*sigsegv_fault_handler_t)(sigsegv_address_t fault_address, sigsegv_address_t instruction_address);
39
39
 
40
40
// Type of a SIGSEGV state dump function
41
41
typedef void (*sigsegv_state_dumper_t)(sigsegv_address_t fault_address, sigsegv_address_t instruction_address);
46
46
// Remove the user SIGSEGV handler, revert to default behavior
47
47
extern void sigsegv_uninstall_handler(void);
48
48
 
49
 
// Add SIGSEGV ignore range
50
 
extern void sigsegv_add_ignore_range(sigsegv_address_t address, unsigned long length, int transfer_type);
51
 
 
52
 
// Remove SIGSEGV ignore range. Range must match installed one, otherwise FALSE is returned.
53
 
extern bool sigsegv_remove_ignore_range(sigsegv_address_t address, unsigned long length, int transfer_type);
54
 
 
55
49
// Set callback function when we cannot handle the fault
56
50
extern void sigsegv_set_dump_state(sigsegv_state_dumper_t handler);
57
51