Getting started using the assembler API
This commit is contained in:
parent
1d7dd68cd0
commit
b411fb9f0b
@ -16,7 +16,46 @@
|
||||
|
||||
|
||||
|
||||
#include <as.h>
|
||||
#include <stdlib.h>
|
||||
#include "target.h"
|
||||
|
||||
|
||||
/* sparc64 */
|
||||
/* private */
|
||||
/* variables */
|
||||
As * as;
|
||||
|
||||
|
||||
/* protected */
|
||||
/* prototypes */
|
||||
static int _sparc64_init(char const * arch, char const * format);
|
||||
static int _sparc64_exit(void);
|
||||
|
||||
|
||||
/* public */
|
||||
/* variables */
|
||||
TargetPlugin target_plugin =
|
||||
{
|
||||
_sparc64_init,
|
||||
_sparc64_exit
|
||||
};
|
||||
|
||||
|
||||
/* protected */
|
||||
/* functions */
|
||||
/* sparc64_init */
|
||||
static int _sparc64_init(char const * arch, char const * format)
|
||||
{
|
||||
if((as = as_new(arch, format)) == NULL)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* sparc64_exit */
|
||||
static int _sparc64_exit(void)
|
||||
{
|
||||
as_delete(as);
|
||||
return 0;
|
||||
}
|
||||
|
@ -22,6 +22,16 @@
|
||||
|
||||
/* Target */
|
||||
/* protected */
|
||||
/* types */
|
||||
typedef struct _Target Target;
|
||||
|
||||
|
||||
/* public */
|
||||
/* types */
|
||||
typedef struct _TargetPlugin
|
||||
{
|
||||
int (*init)(char const *, char const *);
|
||||
int (*exit)(void);
|
||||
} TargetPlugin;
|
||||
|
||||
#endif /* !_C99_TARGET_TARGET_H */
|
||||
|
Loading…
Reference in New Issue
Block a user