~ubuntu-branches/ubuntu/karmic/grub2/karmic-proposed

« back to all changes in this revision

Viewing changes to script/lua/lgc.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-10-14 12:07:42 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20091014120742-52zg4ucfdg5ra1bf
Tags: 1.97~beta4-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  + debian/default/grub:
    - Adjust for default Ubuntu boot options.
    - Use GRUB_CMDLINE_LINUX_DEFAULT option to set "quiet splash" for
      default items only.  These options won't be set in single user mode.
    - Default to hiding the menu; holding down Shift at boot will show it.
  + debian/templates.in:
    - Change default value of grub2/linux_cmdline_default to "quiet
      splash".
  + debian/config.in, debian/postinst.in, debian/grub-pc.templates.in:
    - Migrate timeout settings from menu.lst.
  + debian/grub.d/05_debian_theme:
    - Set a monochromatic theme for Ubuntu.
  + debian/legacy/update-grub:
    - Apply Ubuntu branding: title, recovery mode, quiet option, and tweak
      how memtest86+ is displayed.
    - Use UUIDs where appropriate.
  + debian/control:
    - Conflict with grub (<< 0.97-54) as well as grub-legacy.
  + debian/patches/03_ubuntu_grub_standards:
    - Remove GNU/Linux from default string.
  + debian/patches/10_crashkernel.patch:
    - Add crashkernel= options if kdump and makedumpfile are available.
  + debian/patches/951_quick_boot.diff:
    - If other operating systems are installed, then automatically unhide
      the menu.
    - Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if
      available to check whether Shift is pressed. If it is, show the
      menu, otherwise boot immediately. If keystatus is not available,
      then fall back to a short delay interruptible with Escape.
  + debian/patches/952_sleep_shift.diff:
    - Allow Shift to interrupt 'sleep --interruptible'.
  + debian/patches/954_normal_quiet.diff:
    - Don't display introductory message about line editing unless we're
      actually offering a shell prompt. Don't clear the screen just before
      booting if we never drew the menu in the first place.
  + debian/patches/955_really_quiet.diff:
    - Remove some verbose messages printed before reading the
      configuration file.
  + debian/patches/956_linux_quiet.diff:
    - If the environment variable "quiet" is set to something other than
      0, suppress progress messages as the kernel and initrd load. Set
      this for non-recovery kernel menu entries.
  + debian/patches/957_savedefault.diff, debian/rules:
    - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
      utilities. Provides functionality essentially equivalent to GRUB
      Legacy's savedefault.
  + debian/patches/959_loopback_root.diff:
    - Keep the loopback file open so that subsequent changes to the "root"
      environment variable don't affect it.
  + debian/patches/961_handle_loopback.diff:
    - Change prepare_grub_to_access_device to handle filesystems
      loop-mounted on file images.
  + debian/patches/963_linux_no_loopmount.diff:
    - Ignore devices loop-mounted from files in 10_linux.
  + debian/patches/965_failed_boot_menu.diff, debian/grub-common.init,
    debian/rules:
    - Show the boot menu if the previous boot failed, that is if it failed
      to get to the end of one of the normal runlevels.
* debian/patches/957_savedefault.diff,
  debian/patches/965_failed_boot_menu.diff: Silently ignore zero-sized
  environment blocks (thanks, Felix Zielcke; LP: #439784).
* debian/grub-common.pm-sleep, debian/grub-common.dirs, debian/rules:
  Record a successful boot on resume from hibernate (thanks, Maxim
  Levitsky; LP: #447725).
* debian/postinst.in: Fix backslash-escaping in merge_debconf_into_conf
  (LP: #448413).
* debian/patches/966_mkconfig_probe_option.diff: Backport upstream patch
  to make the grub-install --grub-probe option work, which is useful for
  vm-builder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $
3
 
** Garbage Collector
4
 
** See Copyright Notice in lua.h
5
 
*/
6
 
 
7
 
#ifndef lgc_h
8
 
#define lgc_h
9
 
 
10
 
 
11
 
#include "lobject.h"
12
 
 
13
 
 
14
 
/*
15
 
** Possible states of the Garbage Collector
16
 
*/
17
 
#define GCSpause        0
18
 
#define GCSpropagate    1
19
 
#define GCSsweepstring  2
20
 
#define GCSsweep        3
21
 
#define GCSfinalize     4
22
 
 
23
 
 
24
 
/*
25
 
** some userful bit tricks
26
 
*/
27
 
#define resetbits(x,m)  ((x) &= cast(lu_byte, ~(m)))
28
 
#define setbits(x,m)    ((x) |= (m))
29
 
#define testbits(x,m)   ((x) & (m))
30
 
#define bitmask(b)      (1<<(b))
31
 
#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2))
32
 
#define l_setbit(x,b)   setbits(x, bitmask(b))
33
 
#define resetbit(x,b)   resetbits(x, bitmask(b))
34
 
#define testbit(x,b)    testbits(x, bitmask(b))
35
 
#define set2bits(x,b1,b2)       setbits(x, (bit2mask(b1, b2)))
36
 
#define reset2bits(x,b1,b2)     resetbits(x, (bit2mask(b1, b2)))
37
 
#define test2bits(x,b1,b2)      testbits(x, (bit2mask(b1, b2)))
38
 
 
39
 
 
40
 
 
41
 
/*
42
 
** Layout for bit use in `marked' field:
43
 
** bit 0 - object is white (type 0)
44
 
** bit 1 - object is white (type 1)
45
 
** bit 2 - object is black
46
 
** bit 3 - for userdata: has been finalized
47
 
** bit 3 - for tables: has weak keys
48
 
** bit 4 - for tables: has weak values
49
 
** bit 5 - object is fixed (should not be collected)
50
 
** bit 6 - object is "super" fixed (only the main thread)
51
 
*/
52
 
 
53
 
 
54
 
#define WHITE0BIT       0
55
 
#define WHITE1BIT       1
56
 
#define BLACKBIT        2
57
 
#define FINALIZEDBIT    3
58
 
#define KEYWEAKBIT      3
59
 
#define VALUEWEAKBIT    4
60
 
#define FIXEDBIT        5
61
 
#define SFIXEDBIT       6
62
 
#define WHITEBITS       bit2mask(WHITE0BIT, WHITE1BIT)
63
 
 
64
 
 
65
 
#define iswhite(x)      test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
66
 
#define isblack(x)      testbit((x)->gch.marked, BLACKBIT)
67
 
#define isgray(x)       (!isblack(x) && !iswhite(x))
68
 
 
69
 
#define otherwhite(g)   (g->currentwhite ^ WHITEBITS)
70
 
#define isdead(g,v)     ((v)->gch.marked & otherwhite(g) & WHITEBITS)
71
 
 
72
 
#define changewhite(x)  ((x)->gch.marked ^= WHITEBITS)
73
 
#define gray2black(x)   l_setbit((x)->gch.marked, BLACKBIT)
74
 
 
75
 
#define valiswhite(x)   (iscollectable(x) && iswhite(gcvalue(x)))
76
 
 
77
 
#define luaC_white(g)   cast(lu_byte, (g)->currentwhite & WHITEBITS)
78
 
 
79
 
 
80
 
#define luaC_checkGC(L) { \
81
 
  condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \
82
 
  if (G(L)->totalbytes >= G(L)->GCthreshold) \
83
 
        luaC_step(L); }
84
 
 
85
 
 
86
 
#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p)))  \
87
 
        luaC_barrierf(L,obj2gco(p),gcvalue(v)); }
88
 
 
89
 
#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t)))  \
90
 
        luaC_barrierback(L,t); }
91
 
 
92
 
#define luaC_objbarrier(L,p,o)  \
93
 
        { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \
94
 
                luaC_barrierf(L,obj2gco(p),obj2gco(o)); }
95
 
 
96
 
#define luaC_objbarriert(L,t,o)  \
97
 
   { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }
98
 
 
99
 
LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);
100
 
LUAI_FUNC void luaC_callGCTM (lua_State *L);
101
 
LUAI_FUNC void luaC_freeall (lua_State *L);
102
 
LUAI_FUNC void luaC_step (lua_State *L);
103
 
LUAI_FUNC void luaC_fullgc (lua_State *L);
104
 
LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);
105
 
LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);
106
 
LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
107
 
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
108
 
 
109
 
 
110
 
#endif