diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-26 00:06:38 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-02-27 21:09:14 +0200 |
commit | d29126d9147c0a40635028372b4bbd7e66e40803 (patch) | |
tree | d41baf7ca39dc3fee95edba7a85b9c103d3467df | |
parent | 2cfe606f47211fd24879e1d14733acd03d9b70c0 (diff) |
add stuff to be used for determining which parts of the API kit we need to build
git-svn-id: http://svn.asterisk.org/svn/octasic_api/oct612x/trunk@10 537310ab-6354-42db-a3cc-247b777f7be6
-rw-r--r-- | software/Makefile | 38 | ||||
-rwxr-xr-x | software/get_discards | 51 | ||||
-rw-r--r-- | software/test.c | 43 |
3 files changed, 132 insertions, 0 deletions
diff --git a/software/Makefile b/software/Makefile new file mode 100644 index 0000000..5e6661f --- /dev/null +++ b/software/Makefile @@ -0,0 +1,38 @@ +CFLAGS=-V3.4 -ffunction-sections -Iinclude -Ioctdeviceapi -Ioctdeviceapi/oct6100api -DGFP_ATOMIC=0 -Dkmalloc=calloc -Dkfree=free +LDFLAGS=-V3.4 -Wl,-Map -Wl,test.map -Wl,--gc-sections + +APIDIR=octdeviceapi/oct6100api/oct6100_api + +OCTASIC_OBJS=$(APIDIR)/oct6100_adpcm_chan.o \ + $(APIDIR)/oct6100_channel.o \ + $(APIDIR)/oct6100_chip_open.o \ + $(APIDIR)/oct6100_chip_stats.o \ + $(APIDIR)/oct6100_conf_bridge.o \ + $(APIDIR)/oct6100_debug.o \ + $(APIDIR)/oct6100_events.o \ + $(APIDIR)/oct6100_interrupts.o \ + $(APIDIR)/oct6100_memory.o \ + $(APIDIR)/oct6100_miscellaneous.o \ + $(APIDIR)/oct6100_mixer.o \ + $(APIDIR)/oct6100_phasing_tsst.o \ + $(APIDIR)/oct6100_playout_buf.o \ + $(APIDIR)/oct6100_remote_debug.o \ + $(APIDIR)/oct6100_tlv.o \ + $(APIDIR)/oct6100_tone_detection.o \ + $(APIDIR)/oct6100_tsi_cnct.o \ + $(APIDIR)/oct6100_tsst.o \ + $(APIDIR)/oct6100_user.o \ + apilib/bt/octapi_bt0.o \ + apilib/largmath/octapi_largmath.o \ + apilib/llman/octapi_llman.o + + +all: test + +test.o: test.c + +test: test.o $(OCTASIC_OBJS) + +clean: + rm -rf test test.o + rm -rf $(OCTASIC_OBJS) diff --git a/software/get_discards b/software/get_discards new file mode 100755 index 0000000..5436118 --- /dev/null +++ b/software/get_discards @@ -0,0 +1,51 @@ +#!/usr/bin/php + +<?php +/* + * Written by Jared Smith and Kevin P. Fleming + * + * Copyright (C) 2006, Jared Smith and Digium, Inc. + * + */ + +# create an array of all the different prefixes you want to match on, +# as Perl-compatible regular expressions +# (yes, this is a stupid example, as the second one is just a simplified +# version of the first, but it's just an example) +$prefixes = array('\.text\.Oct'); + +$fp = fopen('test.map','r'); + +while (!feof($fp)) +{ + # Loop until we find the top of section we want + while ($line = fgets($fp)) + { + if (preg_match('/Discarded input sections/i',$line)) + { + break; + } + } + + # Now loop until we find the next section + while ($line = fgets($fp)) + { + if (preg_match('/Memory Configuration/i',$line)) + { + # we found it! + break; + } + foreach ($prefixes as $prefix) + { + if (preg_match("/$prefix/i",$line)) + { + preg_match("/Oct.*/", $line, $matches); + $line2 = fgets($fp); + echo "#define SKIP_".$matches[0]." 1\n"; + break; + } + } + } +} +fclose($fp); +?> diff --git a/software/test.c b/software/test.c new file mode 100644 index 0000000..ac14067 --- /dev/null +++ b/software/test.c @@ -0,0 +1,43 @@ +/* + NOTE: This is not intended to be a functional program. Its only purpose + is to act as a tool to find out what portions of the Octasic API kit we + actually need to link into our drivers. As such, it references every API + call that the actual drivers use, and we let the compiler and linker tell + us what parts of each API module are actually needed to successfully + build this program. + */ +#include "oct6100api/oct6100_api.h" + +int main(int argc, char **argv) +{ + tPOCT6100_INSTANCE_API pApiInstance; + UINT32 ulResult; + tOCT6100_CHANNEL_MODIFY modify; + tOCT6100_INTERRUPT_FLAGS InterruptFlags; + tOCT6100_TONE_EVENT tonefound; + tOCT6100_EVENT_GET_TONE tonesearch; + tOCT6100_CHIP_OPEN ChipOpen; + tOCT6100_GET_INSTANCE_SIZE InstanceSize; + tOCT6100_CHANNEL_OPEN ChannelOpen; + tOCT6100_TONE_DETECTION_ENABLE enable; + tOCT6100_CHIP_CLOSE ChipClose; + + Oct6100ChannelModifyDef(&modify); + ulResult = Oct6100ChannelModify(pApiInstance, &modify); + Oct6100InterruptServiceRoutineDef(&InterruptFlags); + Oct6100InterruptServiceRoutine(pApiInstance, &InterruptFlags); + Oct6100EventGetToneDef(&tonesearch); + ulResult = Oct6100EventGetTone(pApiInstance, &tonesearch); + Oct6100ChipOpenDef(&ChipOpen); + Oct6100GetInstanceSizeDef(&InstanceSize); + ulResult = Oct6100GetInstanceSize(&ChipOpen, &InstanceSize); + ulResult = Oct6100ChipOpen(pApiInstance, &ChipOpen); + Oct6100ChannelOpenDef(&ChannelOpen); + ulResult = Oct6100ChannelOpen(pApiInstance, &ChannelOpen); + Oct6100ToneDetectionEnableDef(&enable); + Oct6100ToneDetectionEnable(pApiInstance, &enable); + Oct6100ChipCloseDef(&ChipClose); + ulResult = Oct6100ChipClose(pApiInstance, &ChipClose); + + return 0; +} |