aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mm-macros
Commit message (Expand)AuthorAgeFilesLines
* tools/mm-macros: Update to 1.0.0Daniel Engberg2020-04-091-3/+5
* tools/mm-macros: Update to 0.9.12Daniel Engberg2018-05-051-2/+2
* tools/mm-macros: Update to 0.9.11Daniel Engberg2017-09-301-2/+2
* treewide: clean up download hashesFelix Fietkau2016-12-161-1/+1
* mm-macros: update to 0.9.10John Crispin2016-03-101-3/+3
* tools/mm-macros: update to 0.9.9Felix Fietkau2015-12-101-4/+3
* tools/mm-macros: update to 0.9.8Felix Fietkau2015-11-061-4/+5
* tools: add back and update mm-macros, it is required for libsigc++Felix Fietkau2015-03-201-0/+31
* tools: remove a bunch of unused automake macrosFelix Fietkau2015-03-171-31/+0
* mm-macros: upgrade to 0.9.6Luka Perkov2013-08-161-4/+4
* mm-macros: update to 0.9.5Florian Fainelli2012-04-021-3/+3
* tools: use host build_dir instead of target build_dirNicolas Thill2011-11-231-1/+1
* add missing makefile in previous commitJo-Philipp Wich2010-12-221-0/+31
D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
    ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.

    This file is part of ChibiOS/RT.

    ChibiOS/RT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    ChibiOS/RT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
 * Core file for Visual Studio 7 demo project.
 */

#ifndef _CHCORE_H_
#define _CHCORE_H_

typedef void *regx86;

/*
 * Stack saved context.
 */
struct stackregs {
  regx86  ebx;
  regx86  edi;
  regx86  esi;
  regx86  ebp;
  regx86  eip;
};

typedef struct {
  struct stackregs *esp;
} Context;

#define APUSH(p, a) (p) -= sizeof(void *), *(void **)(p) = (void*)(a)

#define SETUP_CONTEXT(workspace, wsize, pf, arg) \
{ \
  BYTE8 *esp = (BYTE8 *)workspace + wsize; \
  APUSH(esp, arg); \
  APUSH(esp, threadexit); \
  esp -= sizeof(struct stackregs); \
  ((struct stackregs *)esp)->eip = pf; \
  ((struct stackregs *)esp)->ebx = 0; \
  ((struct stackregs *)esp)->edi = 0; \
  ((struct stackregs *)esp)->esi = 0; \
  ((struct stackregs *)esp)->ebp = 0; \
  tp->p_ctx.esp = (struct stackregs *)esp; \
}

#define chSysLock()

#define chSysUnlock()

#define INT_REQUIRED_STACK 0x0

#define UserStackSize(n) (sizeof(Thread) + sizeof(PTR_EQ) + sizeof(PTR_EQ) + \
                          sizeof(struct stackregs) + (n) + (INT_REQUIRED_STACK))

void __fastcall chSysHalt(void);
void __fastcall chSysPause(void);
void __fastcall chSysSwitchI(Context *oldp, Context *newp);
void __fastcall threadexit(void);

#endif /* _CHCORE_H_ */